Submission #1073339

#TimeUsernameProblemLanguageResultExecution timeMemory
1073339AbitoA Light Inconvenience (CEOI23_light)C++17
0 / 100
366 ms596 KiB
#include "light.h" #include <bits/stdc++.h> #define pb push_back #define int long long #define ep insert using namespace std; set<int> s; int n; void prepare(){ n=1; s.ep(1); } std::pair<long long, std::vector<long long>> join(long long x){ n+=x; set<int> z; for (auto u:s) z.ep(u+x); s.clear(); s.ep(1); for (int i=1;i<=n;){ int j=n+1; auto it=z.upper_bound(i); if (it!=z.end() && *it<=2*i) j=*it; it=z.upper_bound(2*i); if (it!=z.end() && *it<=2*i+x) j=2*i; if (j!=n+1)s.ep(j); i=j; } vector<int> v; for (auto u:s) v.pb(n-u+1); sort(v.begin(),v.end()); return {x,v}; } std::pair<long long, std::vector<long long>> leave(long long x){ n-=x; set<int> z; for (auto u:s) if (u-x>0) z.ep(u-x); s.clear(); s.ep(1); for (int i=1;i<=n;){ int j=n+1; auto it=z.upper_bound(i); if (it!=z.end() && *it<=2*i) j=*it; it=z.upper_bound(2*i); if (it!=z.end() && *it<=2*i+x) j=2*i; if (j!=n+1)s.ep(j); i=j; } vector<int> v; for (auto u:s) v.pb(n-u+1); sort(v.begin(),v.end()); return {x,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...