Submission #1069657

#TimeUsernameProblemLanguageResultExecution timeMemory
1069657AbitoA Light Inconvenience (CEOI23_light)C++17
5 / 100
342 ms428 KiB
#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; int m=n+1; vector<int> v; for (int i=0;m>0;i++){ m-=p[i]; if (m<0) break; v.pb(m); } 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; int m=n+1; vector<int> v; for (int i=0;m>0;i++){ m-=p[i]; if (m<0) break; v.pb(m); } sort(v.begin(),v.end()); if (v[0]!=1) v.pb(1); sort(v.begin(),v.end()); return {x*5,v}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...