제출 #162567

#제출 시각아이디문제언어결과실행 시간메모리
162567brcodeShortcut (IOI16_shortcut)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; const long long MAXN = 2e5+5; long long pref[MAXN]; long long dist(long long x,long long y){ if(x>y){ swap(x,y); } if(x==y){ return 0; } long long res = 0; if(x){ res = pref[x-1]; } return res+pref[y-1]; } long long find_shortcut(long long n, vector<long long> l, vector<long long> d, long long c){ pref[0] = l[0]; for(long long i=1;i<n;i++){ pref[i] = pref[i-1]+l[i]; } long long ans = 0; for(long long i=0;i<n;i++){ for(long long j=i+1;j<n;j++){ long long tempans = 0; for(long long x=0;x<n;x++){ for(long long y=x+1;y<n;y++){ long long hold = min(dist(x,y),min(dist(x,i)+c+dist(y,j),dist(x,j)+c+dist(y,i))); tempans = max(tempans,hold+d[x]+d[y]); } } ans = max(ans,tempans); } } return ans; } int main(){ }

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

/tmp/cc1aY0Cb.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc5LHfxO.o:shortcut.cpp:(.text.startup+0x0): first defined here
/tmp/cc1aY0Cb.o: In function `main':
grader.cpp:(.text.startup+0x10d): undefined reference to `find_shortcut(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, int)'
collect2: error: ld returned 1 exit status