QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#508412 | #7276. A Light Inconvenience | bachbeo2007 | 0 | 7ms | 3808kb | C++23 | 806b | 2024-08-07 15:03:59 | 2024-08-07 15:04:00 |
answer
#include <bits/stdc++.h>
#include "light.h"
using namespace std;
#define ll long long
ll n=1;
vector<ll> f;
vector<ll> get(){
vector<ll> a=f;
for(ll &x:a) x=n+1-x;
reverse(a.begin(),a.end());
return a;
}
void prepare() {
f.push_back(1);
}
pair<ll, vector<ll>> join(ll p) {
n+=p;
while((int)f.size()>2 && f.back()!=f.end()[-2]*2+1) f.pop_back();
while(f.back()<n){
ll x=min(n,f.back()*2+1);
f.push_back(x);
}
return {p,get()};
}
pair<ll, vector<ll>> leave(ll p) {
n-=p;
vector<ll> g;
ll x=0;
while(x<n){
ll y=2*x+1;
for(int u:f){
if(u-2*p>2*x+1) break;
y=min(u-p,2*x+1);
}
g.push_back(y),x=y;
}
f=g;
return {p,get()};
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Memory Limit Exceeded
Test #1:
score: 5
Accepted
time: 1ms
memory: 3460kb
input:
\x03
output:
result:
ok Correct
Test #2:
score: 0
Memory Limit Exceeded
input:
output:
result:
Subtask #2:
score: 0
Wrong Answer
Test #12:
score: 5
Accepted
time: 1ms
memory: 3808kb
input:
\x03
output:
result:
ok Correct
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
!\x02
output:
result:
wrong answer Not correct
Subtask #3:
score: 0
Wrong Answer
Test #24:
score: 10
Accepted
time: 0ms
memory: 3568kb
input:
\x03
output:
result:
ok Correct
Test #25:
score: 0
Wrong Answer
time: 7ms
memory: 3536kb
input:
!\x02
output:
result:
wrong answer Not correct
Subtask #4:
score: 0
Wrong Answer
Test #48:
score: 5
Accepted
time: 1ms
memory: 3464kb
input:
\x03
output:
result:
ok Correct
Test #49:
score: 0
Wrong Answer
time: 3ms
memory: 3508kb
input:
!\x02
output:
result:
wrong answer Not correct
Subtask #5:
score: 0
Wrong Answer
Test #84:
score: 10
Accepted
time: 1ms
memory: 3604kb
input:
\x03
output:
result:
ok Correct
Test #85:
score: 0
Wrong Answer
time: 0ms
memory: 3736kb
input:
!\x02
output:
result:
wrong answer Not correct
Subtask #6:
score: 0
Wrong Answer
Test #132:
score: 5
Accepted
time: 0ms
memory: 3764kb
input:
\x03
output:
result:
ok Correct
Test #133:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
!\x02
output:
result:
wrong answer Not correct
Subtask #7:
score: 0
Memory Limit Exceeded
Test #192:
score: 60
Accepted
time: 1ms
memory: 3588kb
input:
\x03
output:
result:
ok Correct
Test #193:
score: 0
Memory Limit Exceeded