Submission #990355

# Submission time Handle Problem Language Result Execution time Memory
990355 2024-05-30T09:43:26 Z StefanSebez Toy Train (IOI17_train) C++14
5 / 100
5 ms 1372 KB
#include "train.h"
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define ll long long
const int N=5050;
vector<int>E[N];
std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) {
	std::vector<int> res(a.size());
	int n=a.size(),m=u.size();
	for(int i=0;i<m;i++){
		E[u[i]].pb(v[i]);
	}
	for(int i=0;i<n;i++){
		for(int j=i;j<n;){
			bool bul=false,bul2=false;
			for(auto k:E[j]){
				if(k==j+1) bul=true;
				if(k==j) bul2=true;
			}
			//printf("%i: %i %i\n",j,bul2,bul);
			if(a[j]==1){
				if(bul2 && r[j]==1) {res[i]=1;break;}
				else if(bul) j++;
				else {res[i]=0;break;}
			}
			else{
				if(bul2 && r[j]==0) {res[i]=0;break;}
				else if(bul) j++;
				else {res[i]=1;break;}
			}
		}
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 860 KB Output is correct
2 Correct 3 ms 1004 KB Output is correct
3 Correct 2 ms 860 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 2 ms 860 KB Output is correct
6 Correct 2 ms 860 KB Output is correct
7 Correct 2 ms 860 KB Output is correct
8 Correct 2 ms 860 KB Output is correct
9 Correct 2 ms 860 KB Output is correct
10 Correct 2 ms 860 KB Output is correct
11 Correct 2 ms 832 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 8th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 1332 KB Output is correct
2 Correct 4 ms 1372 KB Output is correct
3 Correct 4 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 4 ms 1116 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 4 ms 1368 KB 3rd lines differ - on the 2nd token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 860 KB Output is correct
2 Correct 3 ms 1004 KB Output is correct
3 Correct 2 ms 860 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 2 ms 860 KB Output is correct
6 Correct 2 ms 860 KB Output is correct
7 Correct 2 ms 860 KB Output is correct
8 Correct 2 ms 860 KB Output is correct
9 Correct 2 ms 860 KB Output is correct
10 Correct 2 ms 860 KB Output is correct
11 Correct 2 ms 832 KB Output is correct
12 Incorrect 0 ms 348 KB 3rd lines differ - on the 8th token, expected: '0', found: '1'
13 Halted 0 ms 0 KB -