Submission #617911

#TimeUsernameProblemLanguageResultExecution timeMemory
617911OzyToy Train (IOI17_train)C++17
0 / 100
8 ms1364 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define repa(i,a,b) for (int i = (a); i >= (b); i--) #define lli long long int #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " #define MAX 5000 lli n,m; vector<lli> hijos[MAX]; std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { m = u.size(); rep(i,0,m-1) hijos[u[i]].push_back(v[i]); n = a.size(); vector<int> res; res.resize(n); rep(i,0,n-1) res[i] = a[i]^1; repa(i,n-1,0) { if (a[i] == 1) { for (auto h : hijos[i]) { if (h == i && r[i] == 1) res[i] = 1; else if (res[h] == 1) res[i] == 1; } } else { for (auto h : hijos[i]) { if (h == i && r[i] == 0) res[i] = 0; else if (res[h] == 0) res[i] == 0; } } } 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:29:46: warning: value computed is not used [-Wunused-value]
   29 |                 else if (res[h] == 1) res[i] == 1;
train.cpp:35:46: warning: value computed is not used [-Wunused-value]
   35 |                 else if (res[h] == 0) res[i] == 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...