Submission #582468

# Submission time Handle Problem Language Result Execution time Memory
582468 2022-06-23T21:24:39 Z tutis Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 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);
}
int main()
{

}

Compilation message

art.cpp: In function 'void solve(int)':
art.cpp:24:12: error: 'n' was not declared in this scope
   24 |   int x = (n - 1 - del) / 2;
      |            ^
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) {
      |        ~~~~~~~~~^~~~