# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
413042 |
2021-05-28T06:58:12 Z |
조영욱(#7624) |
Toy Train (IOI17_train) |
C++14 |
|
9 ms |
1000 KB |
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[5000];
vector<int> gph[5000];
bool vis[5000];
int deg[5000];
bool chk[5000];
bool nt[5000];
typedef pair<int,int> P;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
int n=a.size();
int m=u.size();
for(int i=0;i<m;i++) {
if (u[i]==v[i]) {
chk[u[i]]=true;
}
else {
nt[u[i]]=true;
}
}
vector<P> vec;
for(int i=0;i<n;i++) {
if (chk[i]&&r[i]&&a[i]==1) {
vec.push_back(P(i,1));
}
else if (chk[i]&&!r[i]&&a[i]==0) {
vec.push_back(P(i,0));
}
else if (!nt[i]) {
vec.push_back(P(i,1-a[i]));
}
}
vector<int> ret(n);
for(int i=0;i<n;i++) {
ret[i]=(*lower_bound(vec.begin(),vec.end(),P(i,-1))).second;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
716 KB |
Output is correct |
2 |
Correct |
4 ms |
844 KB |
Output is correct |
3 |
Correct |
4 ms |
844 KB |
Output is correct |
4 |
Correct |
4 ms |
844 KB |
Output is correct |
5 |
Correct |
4 ms |
844 KB |
Output is correct |
6 |
Correct |
4 ms |
800 KB |
Output is correct |
7 |
Correct |
4 ms |
844 KB |
Output is correct |
8 |
Correct |
4 ms |
844 KB |
Output is correct |
9 |
Correct |
4 ms |
804 KB |
Output is correct |
10 |
Correct |
5 ms |
844 KB |
Output is correct |
11 |
Correct |
4 ms |
844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
460 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
844 KB |
Output is correct |
2 |
Correct |
7 ms |
928 KB |
Output is correct |
3 |
Correct |
7 ms |
1000 KB |
Output is correct |
4 |
Incorrect |
7 ms |
972 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
808 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
844 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
716 KB |
Output is correct |
2 |
Correct |
4 ms |
844 KB |
Output is correct |
3 |
Correct |
4 ms |
844 KB |
Output is correct |
4 |
Correct |
4 ms |
844 KB |
Output is correct |
5 |
Correct |
4 ms |
844 KB |
Output is correct |
6 |
Correct |
4 ms |
800 KB |
Output is correct |
7 |
Correct |
4 ms |
844 KB |
Output is correct |
8 |
Correct |
4 ms |
844 KB |
Output is correct |
9 |
Correct |
4 ms |
804 KB |
Output is correct |
10 |
Correct |
5 ms |
844 KB |
Output is correct |
11 |
Correct |
4 ms |
844 KB |
Output is correct |
12 |
Incorrect |
1 ms |
460 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
13 |
Halted |
0 ms |
0 KB |
- |