Submission #593920

# Submission time Handle Problem Language Result Execution time Memory
593920 2022-07-11T17:33:02 Z FatihSolak Toy Train (IOI17_train) C++17
0 / 100
2000 ms 1064 KB
#include "train.h"
#include <bits/stdc++.h>
#define N 5005
using namespace std;
int dp[N];
int ndp[N];
vector<int> adj[N];
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<n;i++){
		dp[i] = n;
	}
	for(int i = 0;i<m;i++){
		adj[u[i]].push_back(v[i]);
	}
	for(int i=0;i<10*n;i++){
		for(int j = 0;j<n;j++){
			if(a[j]){
				ndp[j] = -1e9;
				for(auto u:adj[j]){
					ndp[j] = max(ndp[j],dp[u] - 1);
				}
				ndp[j] = min(ndp[j],n);
			}
			else{
				ndp[j] = 1e9;
				for(auto u:adj[j]){
					ndp[j] = min(ndp[j],dp[u] - 1);
				}
			}
		}
		for(int j = 0;j<n;j++){
			dp[j] = ndp[j];
		}
	}
	vector<int> res(n);
	for(int i = 0; i < n; i++){
		res[i] = (dp[i] >= 0);
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1323 ms 772 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 340 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 Execution timed out 2013 ms 1064 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2079 ms 852 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2075 ms 980 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1323 ms 772 KB 3rd lines differ - on the 14th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -