Submission #917284

#TimeUsernameProblemLanguageResultExecution timeMemory
917284NK_Mensza (COI22_mensza)C++17
34 / 100
5047 ms139752 KiB
// Success consists of going from failure to failure without loss of enthusiasm #include <bits/stdc++.h> using namespace std; #define nl '\n' #define pb push_back #define sz(x) int(x.size()) using ll = long long; template<class T> using V = vector<T>; using vl = V<ll>; using vi = V<int>; int main() { cin.tie(0)->sync_with_stdio(0); int L, Q; cin >> L >> Q; for(int q = 0; q < Q; q++) { string s; cin >> s; if (s[0] == 'a') { int a; cin >> a; int cur = 0; vi res; for(int i = 18; i >= 0; i--) { if ((a >> i) & 1) { cur |= (1 << i); res.pb(cur); } } cout << sz(res) << endl; for(auto& x : res) cout << x << " "; cout << endl; } if (s[0] == 'b') { int b; cin >> b; int cur = 0; vi res; for(int i = 18; i >= 0; i--) { if ((b >> i) & 1) { cur |= (1 << i); } else res.pb(cur | (1 << i)); } cout << sz(res) << endl; for(auto& x : res) cout << x << " "; cout << endl; } if (s[0] == 'c') { int k; cin >> k; vi A(k); for(auto& x : A) cin >> x; if (A.back() != 1) cout << "A" << endl; else cout << "B" << endl; } } exit(0-0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...