제출 #1045804

#제출 시각아이디문제언어결과실행 시간메모리
1045804LittleOrange장난감 기차 (IOI17_train)C++17
0 / 100
4 ms1440 KiB
#include "train.h" #include<bits/stdc++.h> using namespace std; using ll = int; std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { ll n = a.size(); ll m = u.size(); std::vector<int> res(a.size()); for(int i = 0; i < (int)res.size(); i++) res[i] = i % 2; vector<vector<ll>> con(n),rcon(n); for(ll i = 0;i<m;i++){ con[u[i]].push_back(v[i]); rcon[v[i]].push_back(u[i]); } vector<ll> ans = r; for(ll i = n-2;i>=0;i--){ if (a[i]){ for(ll j : con[i]) if(j==i+1) ans[i] |= ans[i+1]; } } return ans; }
#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...