Submission #1045825

# Submission time Handle Problem Language Result Execution time Memory
1045825 2024-08-06T07:58:15 Z pcc Toy Train (IOI17_train) C++17
0 / 100
5 ms 860 KB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;

const int mxn = 5050;

vector<int> charge;
int N,M;
queue<int> q;
int owner[mxn];
bitset<mxn> reach[mxn],dist;
vector<int> paths[mxn];
bitset<mxn> ban;
bitset<mxn> cyc;
bitset<mxn> state;

std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) {
	N = a.size();
	for(int i = 0;i<N;i++){
		owner[i] = a[i];
		if(r[i]){
			charge.push_back(i);
			ban[i] = true;
		}
	}
	vector<int> ans(N,-1);
	for(int i = N-1;i>=0;i--){
		if(!owner[i]){
			ans[i] = 0;
			for(auto nxt:paths[i]){
				if(state[nxt]){
					ans[i] = 1;
				}
				else if(nxt == i&&ban[i])ans[i] = 1;
			}
		}
		else{
			ans[i] = 1;
			for(auto nxt:paths[i]){
				if(!state[nxt]){
					ans[i] = 0;
				}
				else if(nxt == i&&!ban[i])ans[i] = 0;
			}
		}
		state[i] = ans[i];
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB 3rd lines differ - on the 3rd token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 860 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 860 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 860 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 2 ms 600 KB 3rd lines differ - on the 3rd token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -