# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
425730 |
2021-06-13T10:37:56 Z |
tc_abd |
Toy Train (IOI17_train) |
C++14 |
|
10 ms |
824 KB |
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define It it=se.begin();it!=se.end();it++
#define mem(dp,i) memset(dp,i,sizeof(dp))
#define all(x) begin(x),end(x)
#define unmap unordered_map
#define pii pair<int,int>
#include <bits/stdc++.h>
#define pll pair<ll,ll>
#define vll vector<ll>
#define vi vector<int>
#define ld long double
#define ll long long
#define pb push_back
#define sh short int
#define mid (l+r)/2
#define S second
#define F first
#define sqr 708
using namespace std;
const ll inf = 1e9+1;
const ll mod = 1e9+7;
const int shift = 1e4;
const ld pai=acos(-1);
#include "train.h"
bool mp[50009][9];
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
int n = a.size(),m = u.size();
for(int i=0;i<m;i++){
if(u[i] == v[i]) mp[u[i]][0] = 1;
else mp[u[i]][1] = 1;
}
vector<int> ret(a.size());
ret[n-1] = r[n-1];
for(int i=n-2;i>=0;i--){
if(r[i]){
if(mp[i][0] == 0 || (a[i] == 0 && mp[i][1] == 1)){
ret[i] = ret[i+1];
}
else ret[i] = 1;
}
else{
if(mp[i][1] == 0 || (a[i] == 0 && mp[i][0] == 1)){
ret[i] = 0;
}
else ret[i] = ret[i+1];
}
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
460 KB |
Output is correct |
2 |
Correct |
4 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
516 KB |
Output is correct |
4 |
Correct |
4 ms |
460 KB |
Output is correct |
5 |
Correct |
4 ms |
460 KB |
Output is correct |
6 |
Correct |
4 ms |
460 KB |
Output is correct |
7 |
Correct |
4 ms |
460 KB |
Output is correct |
8 |
Correct |
4 ms |
540 KB |
Output is correct |
9 |
Correct |
4 ms |
460 KB |
Output is correct |
10 |
Correct |
4 ms |
460 KB |
Output is correct |
11 |
Correct |
3 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 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 |
6 ms |
716 KB |
Output is correct |
2 |
Correct |
10 ms |
752 KB |
Output is correct |
3 |
Correct |
6 ms |
716 KB |
Output is correct |
4 |
Incorrect |
7 ms |
824 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 |
7 ms |
588 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 |
8 ms |
716 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 |
4 ms |
460 KB |
Output is correct |
2 |
Correct |
4 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
516 KB |
Output is correct |
4 |
Correct |
4 ms |
460 KB |
Output is correct |
5 |
Correct |
4 ms |
460 KB |
Output is correct |
6 |
Correct |
4 ms |
460 KB |
Output is correct |
7 |
Correct |
4 ms |
460 KB |
Output is correct |
8 |
Correct |
4 ms |
540 KB |
Output is correct |
9 |
Correct |
4 ms |
460 KB |
Output is correct |
10 |
Correct |
4 ms |
460 KB |
Output is correct |
11 |
Correct |
3 ms |
460 KB |
Output is correct |
12 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
13 |
Halted |
0 ms |
0 KB |
- |