제출 #1163659

#제출 시각아이디문제언어결과실행 시간메모리
1163659dpsaveslivesA Light Inconvenience (CEOI23_light)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "light.h" #define ll long long using namespace std; void prepare(){ } vector<ll> cur = {1}; ll N = 1; //at the beginning pair<ll,vector<ll>> solve(ll p){ N += p; if(p < 0) p *= (-1); vector<ll> lit = {N}; ll x = N; while(x > 1){ x -= min(x-1,N-x+2); int ind = upper_bound(cur.begin(),cur.end(),x)-cur.begin()-1; if(x - cur[ind] >= p+1) x = cur[ind+1]; lit.insert(lit.begin(),x); } swap(lit,cur); return {p,cur}; //light the rightmost p torches and leave the current ones } pair<ll,vector<ll>> join(ll p){ return solve(p); } pair<ll,vector<ll>> leave(ll p){ return solve(-p); } int main() { return 0; }

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

/usr/bin/ld: /tmp/ccWRQS4F.o: in function `main':
interface.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccENZ7Io.o:light.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status