제출 #101033

#제출 시각아이디문제언어결과실행 시간메모리
101033a1_N금 캐기 (IZhO14_divide)C++14
48 / 100
1054 ms1984 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int N = (int)1e5 + 55; int n,a[N],g[N],e[N],ans; main(){ cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i] >> g[i] >> e[i]; } for(int i = 1; i <= n; i++){ int gold = 0,energy = 0; for(int j = i; j <= n; j++){ gold += g[j]; energy += e[j]; if(a[j] - a[i] <= energy){ ans = max(ans, gold); } } } cout << ans; return 0; }

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

divide.cpp:11:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...