답안 #826541

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
826541 2023-08-15T16:35:34 Z caganyanmaz 장난감 기차 (IOI17_train) C++17
5 / 100
4 ms 832 KB
#include <bits/stdc++.h>
#include "train.h"

using namespace std;

constexpr static int MXN = 5000;

bitset<MXN> sl;
bitset<MXN> cc;


vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v)
{
	vector<int> res(a.size());
	for (int i = 0; i < u.size(); i++)
	{
		if (u[i] == v[i] - 1)
			cc[u[i]] = true;
		if (u[i] == v[i])
			sl[u[i]] = true;
	}
	for (int i = a.size()-1; i >= 0; i--)
	{
		if (r[i] && sl[i] && (a[i] || !cc[i]))
			res[i] = 1;
		else if (!r[i] && sl[i] && (!a[i] || !cc[i]))
			res[i] = 0;
		else
			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:15:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for (int i = 0; i < u.size(); i++)
      |                  ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 468 KB Output is correct
2 Correct 3 ms 572 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 2 ms 564 KB Output is correct
5 Correct 3 ms 572 KB Output is correct
6 Correct 2 ms 596 KB Output is correct
7 Correct 3 ms 468 KB Output is correct
8 Correct 2 ms 472 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Correct 2 ms 444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 624 KB Output is correct
2 Correct 4 ms 832 KB Output is correct
3 Correct 4 ms 824 KB Output is correct
4 Incorrect 4 ms 808 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 596 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 640 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 468 KB Output is correct
2 Correct 3 ms 572 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 2 ms 564 KB Output is correct
5 Correct 3 ms 572 KB Output is correct
6 Correct 2 ms 596 KB Output is correct
7 Correct 3 ms 468 KB Output is correct
8 Correct 2 ms 472 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Correct 2 ms 444 KB Output is correct
12 Incorrect 0 ms 212 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
13 Halted 0 ms 0 KB -