# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28616 | tlwpdus 팬클럽 회장 (#68) | LR Springboard (FXCUP2_springboard) | C++14 | 3 ms | 2300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "springboard.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> fv, rv;
set<int> ss;
void Reorder(int N){
PutBall((N + 1) / 2);
int t = PutBall((N + 1) / 2);
int s, e;
if(t == -1){ s = (N + 1) / 2; e = N; }
else{ s = 0; e = (N - 1) / 2; }
for(int i = s; i <= e; i++) ss.insert(i);
while(ss.size() > 1){
fv.clear(); rv.clear();
int c = int(ss.size()) / 2;
for(int i = 0; i < c; i++){
fv.push_back(*ss.begin());
ss.erase(ss.begin());
}
while(!ss.empty()){
rv.push_back(*ss.begin());
ss.erase(ss.begin());
}
int m = N - fv.back();
int t = PutBall(m);
if(t == -1) rv.clear();
else fv.clear();
for(auto &i : fv) ss.insert((i + m) % (N + 1));
for(auto &i : rv) ss.insert((i + m) % (N + 1));
}
if(*ss.begin()) PutBall(N + 1 - *ss.begin());
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |