# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20929 | gs14004 | Rope (JOI17_rope) | C++11 | 559 ms | 70680 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>
typedef long long lint;
typedef long double llf;
using namespace std;
typedef pair<int, int> pi;
int n, m, a[1000005];
int ans[1000005], occ[1000005], sum;
vector<int> pnt[1000005];
void get_table(int s, int e){
sum = 0;
memset(occ, 0, sizeof(occ));
for(int i=1; i<=n; i++) pnt[i].clear();
for(int i=s+1; i<=e; i+=2){
if(a[i-1] == a[i]){
sum += 2;
occ[a[i]] += 2;
pnt[a[i]].push_back(a[i]);
pnt[a[i]].push_back(a[i]);
}
else{
int x = a[i-1], y = a[i];
sum += 2;
occ[x]++;
occ[y]++;
pnt[x].push_back(x);
pnt[x].push_back(y);
pnt[y].push_back(x);
pnt[y].push_back(y);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |