Submission #1254474

#TimeUsernameProblemLanguageResultExecution timeMemory
1254474aren_danceA Light Inconvenience (CEOI23_light)C++20
0 / 100
178 ms412 KiB
#include "light.h" #include <bits/stdc++.h> using namespace std; long long cnt; void prepare(){ cnt = 1; } long long pows(long long x,int y){ long long f=1; for(int i=0;i<y;++i){ f*=x; } return f; } std::pair<long long, std::vector<long long>> join(long long p){ vector<long long> g; int x=1; long long y=p; cnt+=p; p=cnt; g.push_back(p); if(p==1){ return {5*y,g}; } while(pows(2,x)+1<p){ g.push_back(p-pows(2,x)); x++; } g.push_back(1); reverse(g.begin(),g.end()); return {5*y,g}; } std::pair<long long, std::vector<long long>> leave(long long p){ cnt-=p; long long y=p; p=cnt; vector<long long> g; int x=1; g.push_back(p); if(p==1){ return {5*y,g}; } while(pows(2,x)+1<p){ g.push_back(p-pows(2,x)); x++; } g.push_back(1); reverse(g.begin(),g.end()); return {5*y,g}; }
#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...