# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
104970 | 2019-04-10T03:15:44 Z | Aydarov03 | 금 캐기 (IZhO14_divide) | C++14 | 80 ms | 652 KB |
#include <bits/stdc++.h> using namespace std; int x[100005]; int g[100005]; int e[100005]; main() { int n , ans = 0; cin >> n; for(int i = 1; i <= n; i++) { cin >> x[i] >> g[i] >> e[i]; } int gold = 0 , energy = 0; for(int i = 1; i <= n; i++) { gold = 0 , energy = 0; for(int j = i; j <= n; j++) { gold += g[j]; energy += e[j]; if(x[j] - x[i] <= energy) { ans = max(ans , gold); } } } cout << ans << endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 512 KB | Output is correct |
2 | Correct | 1 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 3 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 384 KB | Output is correct |
7 | Correct | 3 ms | 384 KB | Output is correct |
8 | Correct | 3 ms | 384 KB | Output is correct |
9 | Correct | 0 ms | 384 KB | Output is correct |
10 | Correct | 3 ms | 384 KB | Output is correct |
11 | Correct | 2 ms | 512 KB | Output is correct |
12 | Correct | 3 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Incorrect | 4 ms | 384 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 22 ms | 532 KB | Output is correct |
2 | Correct | 80 ms | 652 KB | Output is correct |
3 | Incorrect | 70 ms | 640 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |