# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1060718 | 2024-08-15T21:11:12 Z | MarwenElarbi | A Light Inconvenience (CEOI23_light) | C++17 | 1 ms | 344 KB |
#include <bits/stdc++.h> using namespace std; #include "light.h" #define ll long long #define fi first #define se second #define pb push_back vector<ll> cur; long long n=1; void prepare(){ cur.pb(1); } std::pair<long long, std::vector<long long>> join(long long p){ cur.clear(); n+=p; long long i=1; while(n-i+1>1){ cur.pb(n-i+1); i*=2; } cur.pb(1); sort(cur.begin(),cur.end()); return {p , cur}; } std::pair<long long, std::vector<long long>> leave(long long p){ n-=p; vector<ll> tab; tab.pb(1); for(int i=0;i<cur.size();i++){ if(cur[i]+p>n) break; tab.pb(cur[i]+p); } cur.clear(); tab.pb(n); long long i=1; while(n-i+1>1){ int cnt=upper_bound(cur.begin(),cur.end(),n-i+1)-cur.begin(); cnt--; if(n-i+1-cur[cnt]>p) break; if(n-i+1<=n-p) break; tab.pb(n-i+1); i*=2; } cur=tab; sort(cur.begin(),cur.end()); return {p, cur}; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |