Submission #787255

# Submission time Handle Problem Language Result Execution time Memory
787255 2023-07-19T00:44:33 Z Username4132 Mensza (COI22_mensza) C++17
34 / 100
2600 ms 165368 KB
#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();
}
# Verdict Execution time Memory Grader output
1 Correct 27 ms 552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2600 ms 2944 KB Output is correct
# Verdict Execution time Memory Grader output
1 Failed 2004 ms 165368 KB Input processor failed - contact admins or jury
2 Halted 0 ms 0 KB -