제출 #117683

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1176832019-06-17 06:06:30Plurm장난감 기차 (IOI17_train)C++14
0 / 100
908 ms1396 KiB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> g[5005];
int par[5005];
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
// Subtask 3
int m = u.size();
for(int i = 0; i < m; i++){
g[u[i]].push_back(v[i]);
}
int n = a.size();
vector<int> res;
for(int i = 0; i < n; i++){
memset(par, -1, sizeof(par));
queue<int> q;
q.push(i);
par[i] = i;
while(!q.empty()){
int cur = q.front();
q.pop();
for(int nxt : g[cur]){
if(par[nxt] == -1){
par[nxt] = cur;
q.push(nxt);
}
}
}
bool ok = false;
for(int j = 0; j < n; j++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...