Submission #960976

#TimeUsernameProblemLanguageResultExecution timeMemory
960976PringMensza (COI22_mensza)C++17
100 / 100
1904 ms116712 KiB
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++) using ll = long long; const int MXN = 55; int L, q, n; string s; void fa() { vector<int> v; cin >> n; FOR(i, 0, 19) { int x = (n >> i); if (x & 1) v.push_back((x << 5) + i); } cout << v.size() << ' '; for (auto &i : v) cout << i << ' '; cout << '\n'; } void fb() { vector<int> v; cin >> n; FOR(i, 0, 19) { int x = (n >> i); if (!(x & 1)) v.push_back(((x | 1) << 5) + i); } cout << v.size() << ' '; for (auto &i : v) cout << i << ' '; cout << '\n'; } void fc() { int br; cin >> n; while (n--) cin >> br; cout << (br == 2 ? 'A' : 'B') << '\n'; } void miku() { cin >> L >> q; while (q--) { cin >> s; if (s[0] == 'a') fa(); else if (s[0] == 'b') fb(); else fc(); } } int32_t main() { cin.tie(0) -> sync_with_stdio(false); cin.exceptions(cin.failbit); miku(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...