답안 #332382

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
332382 2020-12-02T07:10:48 Z lumen Traffic (IOI10_traffic) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include<iomanip>
#include<cmath>
using namespace std;
typedef long long int lli;
#define PB push_back
#define MP make_pair
#define FR first
#define SR second
#define LB lower_bound
#define UB upper_bound
typedef vector<long long int> vi;
typedef pair<long long int,long long int> pi;
#define all(a) (a).begin(),(a).end()
#define allr(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=a;i<b;i++)
void LocateCentre(lli N,vi P,vi S,vi D)
{
vi pre(N+1,0);
    FOR(i,1,N+1)
    {
    	pre[i]=pre[i-1]+P[i];
    }
    lli ans=INT_MAX;
    lli index;
    FOR(j,1,N+1)
    {
    	lli point1=max(pre[j-1],pre[N]-pre[j]);
    	if(ans>point1)
    	{
    		ans=point1;
            index=j-1;
    	}
    }
    cout<<index;
}
int main()
{
	 ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli N;
    cin>>N;
    vi P(N+1);
    vi S(N+1),D(N+1);
    FOR(i,1,N+1)
    {
    	cin>>P[i];
    }
    FOR(i,1,N)
    {
    	cin>>S[i];
    }
    FOR(i,1,N)
    {
    	cin>>D[i];
    }
    LocateCentre(N,P,S,D);
    

}  

Compilation message

/tmp/ccXD64vt.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccCEfXSg.o:traffic.cpp:(.text.startup+0x0): first defined here
/tmp/ccXD64vt.o: In function `main':
grader.cpp:(.text.startup+0xd9): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status