Submission #1020935

# Submission time Handle Problem Language Result Execution time Memory
1020935 2024-07-12T11:46:34 Z fv3 Mechanical Doll (IOI18_doll) C++14
6 / 100
36 ms 7208 KB
#include <bits/stdc++.h>
#include "doll.h"

using namespace std;

void create_circuit(int M, vector<int> A) 
{
	vector<int> C(M + 1);
	vector<int> X, Y;

	int last = 0;
	for (int i = 0; i < A.size(); i++)	
	{
		if (C[last])
		{
			X.push_back(C[last]);
			Y.push_back(A[i]);

			C[last] = -X.size();
		}
		else
		{
			C[last] = A[i];
		}

		last = A[i];
	}

	if (C[last])
	{
		X.push_back(C[last]);
		Y.push_back(0);

		C[last] = -X.size();	
	}
	else
	{
		C[last] = 0;
	}

	answer(C, X, Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for (int i = 0; i < A.size(); i++)
      |                  ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 12 ms 2396 KB Output is correct
3 Correct 9 ms 2140 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 1372 KB Output is correct
6 Correct 20 ms 3164 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 12 ms 2396 KB Output is correct
3 Correct 9 ms 2140 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 1372 KB Output is correct
6 Correct 20 ms 3164 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 23 ms 4820 KB Output is correct
9 Correct 22 ms 4568 KB Output is correct
10 Correct 35 ms 7112 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 12 ms 2396 KB Output is correct
3 Correct 9 ms 2140 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 1372 KB Output is correct
6 Correct 20 ms 3164 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 23 ms 4820 KB Output is correct
9 Correct 22 ms 4568 KB Output is correct
10 Correct 35 ms 7112 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 36 ms 7208 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -