| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1185830 | l.alzahrani04 | Divide and conquer (IZhO14_divide) | C++20 | 1093 ms | 1352 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
int n;
cin>>n;
int arr[n][3];
for(int i=0; i<n; i++)
{
for(int j=0; j<3; j++)
{
cin>>arr[i][j];
}
}
int ans=0;
for(int i=0; i<n; i++)
{
int cur_g=0, cur_en=0;
for(int j=i; j<n; j++)
{
cur_g+=arr[j][1];
cur_en+=arr[j][2];
if(cur_en >= abs(arr[j][0]-arr[i][0]))
{
ans=max(ans, cur_g);
}
}
}
cout<<ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
