Submission #340765

# Submission time Handle Problem Language Result Execution time Memory
340765 2020-12-28T10:44:53 Z pggp Toy Train (IOI17_train) C++14
0 / 100
20 ms 748 KB
#include <bits/stdc++.h>

using namespace std;

vector < int > who_wins(vector < int > a, vector < int > r, vector < int > u, vector < int > v){
	vector < int > ans;
	int n = a.size();
	int m = u.size();
	ans.resize(n);
	vector < bool > repeat;
	repeat.resize(n);
	for (int i = 0; i < m; ++i)
	{
		if(u[i] == v[i]){
			repeat[u[i]] = true;
		}
	}
	for(int s = 0; s < n; s++){
		for (int i = s; i < n; ++i)
		{
			if(repeat[i]){
				if(a[i] == 1 and r[i] == 1){
					ans[s] = 1;
					break;
				}
				if(a[i] == 0 and r[i] == 0){
					ans[s] = 0;
					break;
				}
			}
			
			if(i == n - 1){
				if(r[i] == 1){
					ans[s] = 1;
				}
				else{
					ans[s] = 0;
				}
			}
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 492 KB Output is correct
2 Correct 4 ms 492 KB Output is correct
3 Incorrect 4 ms 492 KB 3rd lines differ - on the 355th token, expected: '1', found: '0'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 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 20 ms 748 KB Output is correct
2 Correct 20 ms 748 KB Output is correct
3 Correct 20 ms 748 KB Output is correct
4 Incorrect 20 ms 748 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 15 ms 620 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 14 ms 748 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 Correct 4 ms 492 KB Output is correct
2 Correct 4 ms 492 KB Output is correct
3 Incorrect 4 ms 492 KB 3rd lines differ - on the 355th token, expected: '1', found: '0'
4 Halted 0 ms 0 KB -