Submission #33762

#TimeUsernameProblemLanguageResultExecution timeMemory
33762mohammad_kilaniToy Train (IOI17_train)C++14
0 / 100
1623 ms5596 KiB
#include <bits/stdc++.h> #include "train.h" using namespace std; const int N = 5010; bitset < N > win[N]; std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { vector<int> ans; int n = a.size(); for(int i=0;i<n;i++) win[i][0] = r[i] ; for(int j=1;j<=n;j++){ for(int i=0;i<n;i++) if(r[i]) win[i][j] = 1; else win[i][j] = a[i] ^ 1; for(int i=0;i<u.size();i++){ int o = u[i]; int t = v[i]; if(r[o]) continue; if(a[o]){ if(win[t][j-1]) win[o][j] = 1; } else{ if(win[t][j-1] == 0) win[o][j] = 0; } } } for(int i=0;i<n;i++) ans.push_back(win[i][n]); return ans; }

Compilation message (stderr)

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:14:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<u.size();i++){
                ^
#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...