답안 #593882

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
593882 2022-07-11T17:14:39 Z FatihSolak 장난감 기차 (IOI17_train) C++17
0 / 100
2000 ms 1108 KB
#include "train.h"
#include <bits/stdc++.h>
#define N 5005
using namespace std;
long long dp[N];
long long 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<2*m;i++){
		for(int j = 0;j<n;j++){
			if(a[j]){
				ndp[j] = -1e18;
				for(auto u:adj[j]){
					ndp[j] = max(ndp[j],dp[u] + r[j]*n - 1);
				}
			}
			else{
				ndp[j] = 1e18;
				for(auto u:adj[j]){
					ndp[j] = min(ndp[j],dp[u] + r[j]*n - 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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 370 ms 816 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Incorrect 0 ms 340 KB 3rd lines differ - on the 8th token, expected: '0', found: '1'
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1667 ms 1108 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1451 ms 956 KB Output is correct
2 Correct 1853 ms 1008 KB Output is correct
3 Execution timed out 2089 ms 1108 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2045 ms 980 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 370 ms 816 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -