제출 #1360410

#제출 시각아이디문제언어결과실행 시간메모리
1360410ezzzayArt Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
#include "art.h"
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
void solve(int N) {
	vector<int>v;
	for(int i=1;i<=N;i++)v.pb(i);
	vector<int>cst(N);
	for(int i=0;i<N;i++){
		cst[i]= publish(v);
		
		v.pb(v[0]);
		v.erase(v.begin());
	}
	cst.pb(cst[0]);
	vector<int>ans(N);
	for(int i=0;i<N;i++){
		int e=cst[i];
		int f=cst[i+1];
		int p= (e+f-N+1)/2;
		int x=e-p;
		ans[x]=i+1;
	}
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

art.cpp: In function 'void solve(int)':
art.cpp:26:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   26 |         return ans;
      |                ^~~