Submission #1232304

#TimeUsernameProblemLanguageResultExecution timeMemory
1232304emptypringlescanMensza (COI22_mensza)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main(){= int l; cin >> l; int q; cin >> q; while(q--){ string cmd; cin >> cmd; if(cmd[0]=='a'){ int x; cin >> x; cout << __builtin_popcount(x) << ' '; x^=1<<19; for(int i=18; i>=0; i--){ int yey=x>>i; if(yey&1) cout << (yey^1) << ' '; } cout << endl; } else if(cmd[0]=='b'){ int x; cin >> x; x^=1<<19; cout << 20 << ' '; for(int i=19; i>=0; i--){ int yey=x>>i; cout << yey << ' '; } cout << endl; } else{ int n; cin >> n; int x; for(int i=0; i<n; i++){ cin >> x; } if(x==1) cout << "B" << endl; else cout << "A" << endl; } } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:3:12: error: expected primary-expression before '=' token
    3 | int main(){=
      |            ^
Main.cpp:4:9: error: expected primary-expression before 'int'
    4 |         int l;
      |         ^~~
Main.cpp:5:16: error: 'l' was not declared in this scope
    5 |         cin >> l;
      |                ^