제출 #210186

#제출 시각아이디문제언어결과실행 시간메모리
210186super_j6Xoractive (IZhO19_xoractive)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; #define endl '\n' #define pi pair<int, int> const int maxn = 100000; int n; long long a[maxn], sum[maxn]; int solve(long long x){ long long ret = 0, s = 0; x = sum[x]; for(int i = 0; i < n; i++){ s += a[i]; if(s >= x){ x = s; s = 0; ret++; } } return ret; } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; sum[i] = a[i] + (i ? sum[i - 1] : 0); } int ret = 0; for(int i = 0; i < n; i++) ret = max(ret, solve(i)); cout << ret << endl; return 0; }

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

/tmp/ccoQ1bpS.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc4VrO1b.o:Xoractive.cpp:(.text.startup+0x0): first defined here
/tmp/ccoQ1bpS.o: In function `main':
grader.cpp:(.text.startup+0x1a6): undefined reference to `guess(int)'
collect2: error: ld returned 1 exit status