#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, 19){
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();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2600 ms |
2944 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Failed |
2004 ms |
165368 KB |
Input processor failed - contact admins or jury |
2 |
Halted |
0 ms |
0 KB |
- |