Submission #1135824

#TimeUsernameProblemLanguageResultExecution timeMemory
1135824dombly금 캐기 (IZhO14_divide)C++20
48 / 100
1096 ms1608 KiB
#include <bits/stdc++.h> #define int long long #define F first #define S second #define pb push_back using namespace std; const int N = 1e6 + 10; const int inf = 1e15; const int mod = 1e9 + 7; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int>x(n + 1),g(n + 1),e(n + 1); for(int i = 1; i <= n; i++) { cin >> x[i] >> g[i] >> e[i]; g[i] += g[i - 1]; e[i] += e[i - 1]; } int res = 0; for(int i = 1; i <= n; i++) { for(int j = 1; j <= i; j++) { if(e[i] - e[j - 1] >= x[i] - x[j]) res = max(res,g[i] - g[j - 1]); } } cout << res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...