# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
72853 |
2018-08-27T05:39:12 Z |
Sa1378 |
Toy Train (IOI17_train) |
C++17 |
|
14 ms |
1980 KB |
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
#define N ((int)11*1000)
int n,m;
bool self[N],nex[N],ans[N];
vector<int> who_wins(vector<int> a,vector<int> r,vector<int> u,vector<int> v)
{
n=a.size();m=u.size();
for(int i=0;i<m;i++)
{
if(u[i]==v[i])
self[u[i]]=1;
else nex[min(u[i],v[i])]=1;
}
for(int i=n-1;i>=0;i--)
{
if(!nex[i])
{
ans[i]=r[i];
continue;
}
if(self[i] && a[i]==r[i])ans[i]=a[i];
else ans[i]=ans[i+1];
}
vector <int> res;
for(int i=0;i<n;i++)res.push_back(ans[i]);
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
632 KB |
Output is correct |
2 |
Correct |
9 ms |
872 KB |
Output is correct |
3 |
Correct |
9 ms |
904 KB |
Output is correct |
4 |
Correct |
6 ms |
1112 KB |
Output is correct |
5 |
Correct |
8 ms |
1128 KB |
Output is correct |
6 |
Correct |
7 ms |
1380 KB |
Output is correct |
7 |
Correct |
9 ms |
1552 KB |
Output is correct |
8 |
Correct |
7 ms |
1620 KB |
Output is correct |
9 |
Correct |
6 ms |
1624 KB |
Output is correct |
10 |
Correct |
7 ms |
1704 KB |
Output is correct |
11 |
Correct |
7 ms |
1784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
1784 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 |
Incorrect |
11 ms |
1980 KB |
3rd lines differ - on the 1360th token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
1980 KB |
3rd lines differ - on the 696th token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
1980 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 |
7 ms |
632 KB |
Output is correct |
2 |
Correct |
9 ms |
872 KB |
Output is correct |
3 |
Correct |
9 ms |
904 KB |
Output is correct |
4 |
Correct |
6 ms |
1112 KB |
Output is correct |
5 |
Correct |
8 ms |
1128 KB |
Output is correct |
6 |
Correct |
7 ms |
1380 KB |
Output is correct |
7 |
Correct |
9 ms |
1552 KB |
Output is correct |
8 |
Correct |
7 ms |
1620 KB |
Output is correct |
9 |
Correct |
6 ms |
1624 KB |
Output is correct |
10 |
Correct |
7 ms |
1704 KB |
Output is correct |
11 |
Correct |
7 ms |
1784 KB |
Output is correct |
12 |
Incorrect |
4 ms |
1784 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
13 |
Halted |
0 ms |
0 KB |
- |