제출 #1354305

#제출 시각아이디문제언어결과실행 시간메모리
1354305jellybeanMinerals (JOI19_minerals)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define dd(x) cout<<#x<<" is "<<x<<endl;
#define dd2(x,y) cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<endl;
typedef pair<int,int> pii;

signed main(){
	ios::sync_with_stdio(0); cin.tie(0);
	
	int n,l; cin>>n>>l;
	int a[n+1], psum[n+1];
	pii ans[n+1];
	for(int i=1; i<=n; i++) cin>>a[i];
	for(int i=1; i<=n; i++) psum[i] = psum[i-1] + a[i];
	
	int ptr = n;
	for(int i=n; i>0; i--){
		while(psum[i-1] + l < psum[ptr]) ptr--;
		int id = ptr+1;
		if(id > n) ans[i] = {1, psum[n] - psum[i-1]};
		else ans[i] = {ans[id].fi + 1, ans[id].se};
	}
	
	for(int i=1; i<=n; i++) cout<<ans[i].fi<<" "<<ans[i].se<<"\n";
	
	return 0;
}

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

/usr/bin/ld: /tmp/ccEI2Pv5.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc1jZblI.o:minerals.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccEI2Pv5.o: in function `main':
grader.cpp:(.text.startup+0xc4): undefined reference to `Solve(int)'
collect2: error: ld returned 1 exit status