제출 #1123140

#제출 시각아이디문제언어결과실행 시간메모리
112314012345678A Light Inconvenience (CEOI23_light)C++17
0 / 100
599 ms416 KiB
#include "light.h" #include <bits/stdc++.h> using namespace std; long long pw[65], cnt; void prepare(){ pw[0]=cnt=1; for (int i=1; i<65; i++) pw[i]=pw[i-1]*2; } vector<long long> solve() { set<long long> s; s.insert(1); for (int i=0; i<60; i++) { if (pw[i]>cnt) break; long long cur=(cnt/pw[i])*pw[i]; s.insert(cur); if (cur-pw[i]>=1) s.insert(cur-pw[i]); if (cur-2*pw[i]>=1) s.insert(cur-2*pw[i]); if (((cur%pw[i+1])==0)&&cur-3*pw[i]>=1) s.insert(cur-3*pw[i]); } vector<long long> res; for (auto x:s) res.push_back(x); return res; } std::pair<long long, std::vector<long long>> join(long long p){ cnt+=p; return {p, solve()}; } std::pair<long long, std::vector<long long>> leave(long long p){ cnt-=p; return {p, solve()}; }
#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...