Submission #787253

#TimeUsernameProblemLanguageResultExecution timeMemory
787253Username4132Mensza (COI22_mensza)C++17
0 / 100
1378 ms30776 KiB
#include<iostream> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) string s; inline int encode(int a, int b, int c, int d){ return (a<<8) + (b<<2) + (c<<1) + d; } void solve(){ cin >> s; if(s[0]=='c'){ int m, a; cin >> m; forn(i, m) cin >> a; cout << (a==1? 'B' : 'A') << endl; } else{ int num; cin >> num; string ret("19"); forn(i, 3){ int dig = !(num & (1<<i)); ret.append(" "); ret.append(to_string(encode(num&((1<<24) - (1<<(i+1))), i, dig^(s[0]=='a'), dig|(s[0]=='a')))); } cout << ret << endl; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int a, t; cin >> a >> t; while(t--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...