# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1040378 | vjudge1 | Divide and conquer (IZhO14_divide) | C++17 | 1037 ms | 5712 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
main()
{
long long n;
cin >> n;
long long x[n+1],g[n+1],d[n+1];
for (long long i=1; i<=n; i++) cin >> x[i] >> g[i] >> d[i];
long long res=0;
for (long long i=1; i<=n; i++)
{
long long temp=0,temp2=0;
for (long long j=i; j<=n; j++)
{
temp+=g[j];
temp2+=d[j];
if (x[j]-x[i]<=temp2) res=max(res,temp);
}
}
cout << res;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |