Submission #582470

# Submission time Handle Problem Language Result Execution time Memory
582470 2022-06-23T21:25:23 Z tutis Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include <bits/stdc++.h>
#include "art.h"
using namespace std;
mt19937_64 rng(0);
void solve(int N)
{
	int ans[N];
	vector<int>P(N);
	for (int t = 0; t < N; t++)
	{
		for (int i = 0; i < N; i++)
			P[i] = (i + t) % N + 1;
		ans[t] = publish(P);
	}
	for (int i = 0; i < N; i++)
	{
		int del = ans[i] - ans[(i + 1) % N];
		//x k y
		//k xy      x
		//xy k      y
		//del = y - x
		//n-1 = x + y
		//n-1-del = x+y+x-y =2x
		int x = (N - 1 - del) / 2;
		P[x] = i + 1;
	}
	answer(P);
}

Compilation message

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -