제출 #1306303

#제출 시각아이디문제언어결과실행 시간메모리
1306303michael12Divide and conquer (IZhO14_divide)C++20
48 / 100
1093 ms1596 KiB
#include<bits/stdc++.h> #define int long long using namespace std; struct camp{ int x, y, z; }; signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<camp> a(n); for(int i = 0; i < n; i++){ cin >> a[i].x >> a[i].y >> a[i].z; } int l = 0, mx = 0; for(int i = 0; i < n; i++){ int E = 0; int G = 0; for(int j = i; j < n; j++){ E += a[j].z; G += a[j].y; if(E >= a[j].x - a[i].x + 1){ mx = max(mx, G); } } } cout << mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...