Submission #969292

# Submission time Handle Problem Language Result Execution time Memory
969292 2024-04-24T22:11:32 Z mariaclara Toy Train (IOI17_train) C++17
0 / 100
5 ms 1372 KB
#include "train.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pii;
const int INF = 1e9+10;
const ll LINF = 1e18+10;
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define mk make_pair
#define pb push_back
#define f first 
#define s second

vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
	int n = sz(a), m = sz(u);
	vector<int> res(n);
	vector<int> edges[n];

	queue<int> fila;

	for(int i = 0; i < m; i++) {
		edges[v[i]].pb(u[i]);
		if(v[i] == u[i] and r[v[i]]) fila.push(v[i]);
	}

	while(!fila.empty()) {
		int x = fila.front();
		fila.pop();

		if(res[x]) continue;
		res[x] = 1;

		for(auto viz : edges[x])
			fila.push(viz);
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1012 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 0 ms 344 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 5 ms 1372 KB Output is correct
2 Correct 5 ms 1372 KB Output is correct
3 Correct 5 ms 1372 KB Output is correct
4 Incorrect 5 ms 1372 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 1268 KB 3rd lines differ - on the 696th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1372 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 4 ms 1012 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -