Submission #826537

# Submission time Handle Problem Language Result Execution time Memory
826537 2023-08-15T16:34:26 Z caganyanmaz Toy Train (IOI17_train) C++17
0 / 100
4 ms 852 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++)
      |                  ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 596 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 852 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 744 KB 3rd lines differ - on the 696th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 828 KB 3rd lines differ - on the 2nd token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 596 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -