Submission #826541

#TimeUsernameProblemLanguageResultExecution timeMemory
826541caganyanmazToy Train (IOI17_train)C++17
5 / 100
4 ms832 KiB
#include <bits/stdc++.h> #include "train.h" using namespace std; constexpr static int MXN = 5000; bitset<MXN> sl; bitset<MXN> cc; vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { vector<int> res(a.size()); for (int i = 0; i < u.size(); i++) { if (u[i] == v[i] - 1) cc[u[i]] = true; if (u[i] == v[i]) sl[u[i]] = true; } for (int i = a.size()-1; i >= 0; i--) { if (r[i] && sl[i] && (a[i] || !cc[i])) res[i] = 1; else if (!r[i] && sl[i] && (!a[i] || !cc[i])) res[i] = 0; else res[i] = res[i+1]; } return res; }

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:15:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  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...