제출 #1181483

#제출 시각아이디문제언어결과실행 시간메모리
1181483boclobanchatMensza (COI22_mensza)C++20
0 / 100
1567 ms68808 KiB
#include<bits/stdc++.h> using namespace std; int main() { // ifstream cin("input.txt"); // ofstream cout("output.txt"); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int l,q; cin>>l>>q; for(int i=1;i<=q;i++) { string t; cin>>t; if(t=="alojzije") { int res; cin>>res; int val=0; vector<int> ans; for(int j=18;j+1;j--) { val+=(res&(1<<j)); if(val&(1<<j)) ans.push_back(val); } cout<<ans.size()<<" "; for(auto v:ans) cout<<v<<" "; cout<<endl; } else if(t=="benjamin") { int res; cin>>res; int val=0; vector<int> ans; for(int j=18;j+1;j--) { val+=(res&(1<<j)); if(!(val&(1<<j))) ans.push_back((val^(1<<j))); } cout<<ans.size()<<" "; for(auto v:ans) cout<<v<<" "; cout<<endl; } else { int sz; cin>>sz; bool ck=false; while(sz--) { int res; cin>>res; ck|=(res==2); } if(ck) cout<<"A"<<endl; else cout<<"B"<<endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...