답안 #413070

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
413070 2021-05-28T07:59:16 Z 장태환(#7546) 장난감 기차 (IOI17_train) C++14
5 / 100
8 ms 736 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]||(vec[i][0] && r[i])))
		{
			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++)
      |              ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 504 KB Output is correct
2 Correct 4 ms 560 KB Output is correct
3 Correct 4 ms 556 KB Output is correct
4 Correct 4 ms 560 KB Output is correct
5 Correct 4 ms 588 KB Output is correct
6 Correct 4 ms 588 KB Output is correct
7 Correct 4 ms 588 KB Output is correct
8 Correct 4 ms 588 KB Output is correct
9 Correct 6 ms 588 KB Output is correct
10 Correct 4 ms 588 KB Output is correct
11 Correct 4 ms 460 KB Output is correct
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 736 KB 3rd lines differ - on the 78th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 588 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 736 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 504 KB Output is correct
2 Correct 4 ms 560 KB Output is correct
3 Correct 4 ms 556 KB Output is correct
4 Correct 4 ms 560 KB Output is correct
5 Correct 4 ms 588 KB Output is correct
6 Correct 4 ms 588 KB Output is correct
7 Correct 4 ms 588 KB Output is correct
8 Correct 4 ms 588 KB Output is correct
9 Correct 6 ms 588 KB Output is correct
10 Correct 4 ms 588 KB Output is correct
11 Correct 4 ms 460 KB Output is correct
12 Incorrect 1 ms 204 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
13 Halted 0 ms 0 KB -