Submission #886019

#TimeUsernameProblemLanguageResultExecution timeMemory
886019waldiToy Train (IOI17_train)C++17
5 / 100
5 ms1372 KiB
#include "train.h" #include <bits/stdc++.h> #define FOR(i,p,k) for(int i=(p);i<=(k);++i) #define REP(i,n) FOR(i,0,(n)-1) #define ssize(x) (int((x).size())) #define all(x) (x).begin(),(x).end() using namespace std; vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v){ int n = ssize(a); int m = ssize(u); vector<int> ret(n); vector<vector<int>> g(n); REP(i, m) g[u[i]].emplace_back(v[i]); bool sciezka = 1; REP(i, m) if(u[i] != v[i] && v[i] != u[i]+1) sciezka = 0; if(sciezka){ for(int i = n; ~--i;){ bool petla = 0, dalej = 0; for(int j : g[i]){ if(j == i) petla = 1; if(j == i+1) dalej = 1; } if(a[i]){ ret[i] = 0; if(petla && r[i]) ret[i] |= 1; if(dalej) ret[i] |= ret[i+1]; } else{ ret[i] = 1; if(petla && !r[i]) ret[i] &= 0; if(dalej) ret[i] &= ret[i+1]; } } return ret; } REP(i, n){ } return ret; }
#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...