Submission #675275

#TimeUsernameProblemLanguageResultExecution timeMemory
675275hotboy2703Football (info1cup20_football)C++14
50 / 100
95 ms596 KiB
#include<bits/stdc++.h> using namespace std; bool solve(vector <int> a,int k,bool rev){ long long cnt[2] = {}; for (auto x:a)cnt[x&1]++; if (k == 1){ return ((cnt[1]&1)^rev); } else{ vector <int> tmp; for (auto x:a){ if ((x&1) == 0){ tmp.push_back(x/2); } } return solve(tmp,k/2,(rev ^ (cnt[1]&1))); } } int main(){ ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr); int t; cin>>t; while (t--){ int n,k; cin>>n>>k; vector <int> a(n); for (auto &x:a)cin>>x; cout<<solve(a,k,0); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...