Submission #1005661

#TimeUsernameProblemLanguageResultExecution timeMemory
1005661vicvicFootball (info1cup20_football)C++11
26 / 100
102 ms864 KiB
#include <iostream> using namespace std; int t; void solve () { int n, k, v[100005]; cin >> n >> k; long long int s=0; for (int i=1;i<=n;i++) { cin >> v[i]; s+=v[i]; } if (s%2==1) { cout << 1; } else { if (k==1) { cout << 0; return; } if (k>1 && n==1 && v[n]<=k) { cout << 1; return; } for (int i=1;i<=n;i++) { if (v[i]%2==1) { cout << 1; return; } } cout << 0; return; } return; } int main() { ios :: sync_with_stdio (0); cin.tie (nullptr); cin >> t; while (t--) { solve (); } 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...