제출 #1122874

#제출 시각아이디문제언어결과실행 시간메모리
1122874omsincoconutA Light Inconvenience (CEOI23_light)C++17
0 / 100
264 ms436 KiB
#include "light.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll> cur; void prepare() { cur = {1}; } pair<ll, vector<ll>> join(ll p) { ll cz = cur.back() + p; vector<ll> newcur; for (ll i = 1; i <= cz; i *= 2) { newcur.push_back(i); newcur.push_back(cz-i+1); } sort(newcur.begin(), newcur.end()); newcur.resize(unique(newcur.begin(), newcur.end()) - newcur.begin()); ll t = 0; for (ll i : newcur) { t = max(t, i - *(upper_bound(cur.begin(), cur.end(), i) - 1)); } cur = newcur; return make_pair(t, cur); } pair<ll, vector<ll>> leave(ll p){ ll cz = cur.back() - p; vector<ll> newcur; for (ll i = 1; i <= cz; i *= 2) { newcur.push_back(i); newcur.push_back(cz-i+1); } sort(newcur.begin(), newcur.end()); newcur.resize(unique(newcur.begin(), newcur.end()) - newcur.begin()); ll t = 0; for (ll i : newcur) { t = max(t, i - *(upper_bound(cur.begin(), cur.end(), i) - 1)); } cur = newcur; return make_pair(t, cur); }
#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...