Submission #11561097
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int a = S.size(); int TZ = 0; int NB = 0; for(int i = 0; i < a; i++){ if(S[i] == N) NB++; else if(S[i] == S) NB--; else if (S[i] == W) TZ++; else TZ--; } if(TZ == 0 && NB == 0){ cout << "Yes" << endl; } else cout << "No" << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Wanna go back home |
User | nenokatas |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 374 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:11:15: error: ‘N’ was not declared in this scope if(S[i] == N) NB++; ^ ./Main.cpp:12:18: error: no match for ‘operator==’ (operand types are ‘char’ and ‘std::string {aka std::basic_string<char>}’) else if(S[i] == S) NB--; ^ In file included from /usr/include/c++/5/unordered_set:48:0, from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:116, from ./Main.cpp:1: /usr/include/c++/5/bits/unordered_set.h:1421:5: note: candidate: template<class _Value, class _Hash, class _Pred, class _Alloc> bool std::operator==(const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&, const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&) operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, ^ /usr/include/c++/5/bits/unordered_set.h:1421:5: note: template argument deduction/substitution failed: ./Main.cpp:12:21: note: mismatched types ‘const std::unordered_multis...