Submission #669394

# Submission time Handle Problem Language Result Execution time Memory
669394 2022-12-06T10:59:42 Z someone Toy Train (IOI17_train) C++14
0 / 100
7 ms 2132 KB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
 
const int N = 10 + 42, INF = 1e9;
 
int n, m, dp[N*N][N];
vector<int> adj[N], ans;
 
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
	n = a.size();
	m = u.size();
	for(int i = 0; i < m; i++)
        adj[v[i]].push_back(u[i]);
    
    for(int i = 0; i < n*n+42; i++) {
        for(int j = 0; j < n; j++) {
            dp[i+1][j] = dp[i][j];
            if(a[j]) {
                for(int k : adj[j])
                    dp[i+1][j] = max(dp[i+1][j], dp[i][k]);
            } else {
                for(int k : adj[j])
                    dp[i+1][j] = min(dp[i+1][j], dp[i][k]);
            }
            if(r[j])
                dp[i+1][j]++;
	    }
	}
	
	for(int j = 0; j < n; j++)
	    ans.push_back((dp[n*n+42][j] > n));
	
	return ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 1364 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 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 Runtime error 6 ms 2132 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 1748 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1996 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 1364 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -