Submission #72850

# Submission time Handle Problem Language Result Execution time Memory
72850 2018-08-27T05:35:32 Z Sa1378 Toy Train (IOI17_train) C++17
0 / 100
10 ms 1984 KB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
#define N ((int)2010)

int n,m;
bool self[N],nex[N],ans[N];

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++)
	{
		if(u[i]==v[i])
			self[u[i]]=1;
		else nex[min(u[i],v[i])]=1;
	}
	for(int i=n-1;i>=0;i--)
	{
		if(!nex[i])
		{
			ans[i]=r[i];
			continue;
		}
		if(self[i] && a[i]==r[i])ans[i]=a[i];
		else ans[i]=ans[i+1];
	}
	vector <int> res;
	for(int i=0;i<n;i++)res.push_back(ans[i]);
	return res;
}
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1272 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 Runtime error 10 ms 1860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 1860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 1984 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -