답안 #582469

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
582469 2022-06-23T21:25:05 Z tutis Art Collections (BOI22_art) C++17
컴파일 오류
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

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) {
      |        ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccvi1JEE.o: in function `main':
interface.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclilEHF.o:art.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status