답안 #592757

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
592757 2022-07-09T14:41:15 Z Blagojce Art Collections (BOI22_art) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i <= (m); i ++)
#define st first
#define nd second
#define pb push_back
#define pq priority_queue
#define all(x) begin(x), end(x)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;

#include "art.h";



void solve(int N){
	vector<int> v;
	fr(i, 1, N){
		v.pb(i);
	}
	vector<int> ans(N);
	fr(i, 0, N-1){
		swap(v[i], v.back();
		int pos = publish(v);
		swap(v[i], v.back();
		
		ans[N-pos-1] = v[i];
	}
	answer(ans);
}

Compilation message

art.cpp:14:17: warning: extra tokens at end of #include directive
   14 | #include "art.h";
      |                 ^
art.cpp: In function 'void solve(int)':
art.cpp:25:22: error: expected ')' before ';' token
   25 |   swap(v[i], v.back();
      |       ~              ^
      |                      )
art.cpp:27:22: error: expected ')' before ';' token
   27 |   swap(v[i], v.back();
      |       ~              ^
      |                      )
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) {
      |        ~~~~~~~~~^~~~