Submission #425718

# Submission time Handle Problem Language Result Execution time Memory
425718 2021-06-13T10:29:39 Z tc_abd Toy Train (IOI17_train) C++14
0 / 100
10 ms 760 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] = 0;
        }
        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 Incorrect 5 ms 460 KB 3rd lines differ - on the 14th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 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 7 ms 716 KB Output is correct
2 Correct 8 ms 760 KB Output is correct
3 Correct 9 ms 748 KB Output is correct
4 Incorrect 10 ms 716 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 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 7 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 Incorrect 5 ms 460 KB 3rd lines differ - on the 14th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -