Submission #1027502

#TimeUsernameProblemLanguageResultExecution timeMemory
1027502vjudge1Football (info1cup20_football)C++17
0 / 100
1607 ms1048576 KiB
#include <bits/stdc++.h> using namespace std; void f(){ #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif } int k; int solve(vector<int> a, int b){ int n=a.size(), s=0; if(b>k) return 0; for(auto i: a) cin >> i, s+=i; if(s%2) return 1; else if(s==0) return 0; else{ for(int i=0; i<n; i++){ a[i]/=2; } return solve(a, b*2); } } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); //f(); srand(time(0)); int t; cin >> t; while(t--){ int n; cin >> n >> k; vector<int> a(n); for(auto &i: a) cin >> i; cout<<solve(a, 1); } }

Compilation message (stderr)

football.cpp: In function 'void f()':
football.cpp:6:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  freopen("in.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
football.cpp:7:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  freopen("out.txt", "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#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...