# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1006289 | makanhulia | Bigger segments (IZhO19_segments) | C++17 | 283 ms | 47396 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;
# define int long long
# define fir first
# define sec second
# define pb push_back
# define endl "\n"
const int cnst = 2e5+5;
bool mutipletestcase = 0;
//bool debug = false;
void solve() {
int n; cin >> n;
int num[n+5];
int dp[n+5]; dp[0] = 0;
int pos[n+5];
memset(pos, 0, sizeof(pos));
int pre[n+5]; pre[0] = 0; pre[n+1] = 1e18;
set<pair<int, int>> st;
for(int i = 1; i<=n; i++) cin >> num[i];
for(int i = 1; i<=n; i++) pre[i] = pre[i-1]+num[i];
for(int i = 1; i<=n; i++) st.insert({pre[i], i});
st.insert({pre[n+1], n+1});
for(int i = 1; i<=n; i++) {
pos[i] = max(pos[i], pos[i-1]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |