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 "light.h"
#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;
int n,p[27];
void prepare(){
n=1;
p[0]=1;
for (int i=1;i<27;i++) p[i]=p[i-1]*5;
}
std::pair<long long, std::vector<long long>> join(long long x){
n+=x;
vector<int> v;
for (int i=0;n-p[i]+1>0;i++){
v.pb(n-p[i]+1);
}
sort(v.begin(),v.end());
if (v[0]!=1) v.pb(1);
sort(v.begin(),v.end());
return {x*5,v};
}
std::pair<long long, std::vector<long long>> leave(long long x){
n-=x;
vector<int> v;
for (int i=1;n-p[i]+1>0;i++){
v.pb(n-p[i]+1);
}
sort(v.begin(),v.end());
if (v[0]!=1) v.pb(1);
sort(v.begin(),v.end());
return {x*5,v};
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |