Submission #959897

#TimeUsernameProblemLanguageResultExecution timeMemory
959897pccMensza (COI22_mensza)C++17
0 / 100
1 ms596 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,popcnt,sse4") #define pii pair<int,int> #define fs first #define sc second #define ll long long int L; namespace SA{ vector<int> v; void GO(int n){ v.clear(); for(int i = 0;i<10;i++){ if(n&(1<<i)){ for(int j = 0;j<i*2+1;j++)v.push_back(i*2+1); } } cout<<v.size()<<' ';for(auto &i:v)cout<<i<<' ';cout<<'\n'; return; } } namespace SB{ vector<int> v; void GO(int n){ v.clear(); for(int i = 0;i<10;i++){ if(n&(1<<i)){ for(int j = 0;j<i*2+2;j++)v.push_back(i*2+2); } } cout<<v.size()<<' ';for(auto &i:v)cout<<i<<' ';cout<<'\n'; return; } } namespace SC{ void GO(int n){ int a = 0,b = 0; for(int i = 0;i<n;i++){ int k; cin>>k; if(k&1)a^=1<<(k/2); else b ^= 1<<(k/2-1); } cout<<(a>b?"A\n":"B\n"); return; } } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int t; cin>>t; while(t--){ string s; int n; cin>>s>>n; if(s[0] == 'a')SA::GO(n); else if(s[0] == 'b')SB::GO(n); else SC::GO(n); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...