답안 #969292

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
969292 2024-04-24T22:11:32 Z mariaclara 장난감 기차 (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;
}
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -