Submission #413068

# Submission time Handle Problem Language Result Execution time Memory
413068 2021-05-28T07:55:51 Z 장태환(#7546) Toy Train (IOI17_train) C++14
0 / 100
10 ms 868 KB
#include "train.h"
using namespace std;
int vec[200100][2];
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 i;
	for (i = 0; i < u.size(); i++)
	{
		vec[u[i]][v[i] - u[i]] = 1;
	}
	for (i = a.size() - 1; i >= 0; i--)
	{
		if (vec[i][0]&&r[i]&&(a[i]||!vec[i][1]))
		{
			res[i] = 1;
		}
		if (vec[i][1]&&(a[i]||!vec[i][0]))
		{
			res[i] |= res[i + 1];
		}
	}
	return res;
}

Compilation message

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:7:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for (i = 0; i < u.size(); i++)
      |              ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 516 KB 3rd lines differ - on the 26th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 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 Incorrect 10 ms 868 KB 3rd lines differ - on the 78th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 716 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 7 ms 864 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 5 ms 516 KB 3rd lines differ - on the 26th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -