Submission #1027514

#TimeUsernameProblemLanguageResultExecution timeMemory
1027514vjudge1Football (info1cup20_football)C++17
0 / 100
2075 ms1048576 KiB
#include <bits/stdc++.h> using namespace std; #define int long long 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 0; } } 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:7:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  freopen("in.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
football.cpp:8:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  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...