QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#424631#7276. A Light InconvenienceLynkcat#0 72ms3828kbC++201.1kb2024-05-29 14:34:562024-05-29 14:34:56

Judging History

你现在查看的是最新测评结果

  • [2024-05-29 14:34:56]
  • 评测
  • 测评结果:0
  • 用时:72ms
  • 内存:3828kb
  • [2024-05-29 14:34:56]
  • 提交

answer

#include <bits/stdc++.h>
#include "light.h"
// #include "sample_grader.cpp"

using namespace std;

namespace 
{
    long long N = 1;
    vector<long long> v;
}

void prepare() {
    v.push_back(1);
}

vector<long long> get() {
    vector<long long>res=v;
    for (auto &u:res) u=N-u+1;
    reverse(res.begin(),res.end());
    return res;
}

pair<long long, vector<long long>> join(long long p) {
    N += p;
    while (v.back()!=N)
    {
        long long  n=v.back()*2+1;
        if (n>N)
        {
            v.push_back(N);
        } else v.push_back(n);
    }
    assert(v.size()<=150);
    return {p, get()};
}

pair<long long, vector<long long>> leave(long long p) {
    N -= p;
    vector<long long>res;
    long long nw=0;
    while (nw<N)
    {
        long long rl=2*nw+1;
        for (auto u:v)
        {
            if (u-2*p>2*nw+1) break;
            rl=min(2*nw+1,u-p);
        }
        assert(rl>nw);
        res.push_back(rl);
        nw=rl;
    }
    v=res;
    assert(v.size()<=150);
    return {p, get()};
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 5
Accepted
time: 1ms
memory: 3576kb

input:

\x03

output:


result:

ok Correct

Test #2:

score: -5
Runtime Error

input:


output:


result:


Subtask #2:

score: 0
Runtime Error

Test #12:

score: 5
Accepted
time: 0ms
memory: 3484kb

input:

\x03

output:


result:

ok Correct

Test #13:

score: 0
Accepted
time: 46ms
memory: 3828kb

input:

!\x02

output:


result:

ok Correct

Test #14:

score: -5
Runtime Error

input:

\x02

output:


result:


Subtask #3:

score: 0
Runtime Error

Test #24:

score: 10
Accepted
time: 1ms
memory: 3636kb

input:

\x03

output:


result:

ok Correct

Test #25:

score: 0
Accepted
time: 58ms
memory: 3604kb

input:

!\x02

output:


result:

ok Correct

Test #26:

score: -10
Runtime Error

input:

\x02

output:


result:


Subtask #4:

score: 0
Runtime Error

Test #48:

score: 5
Accepted
time: 1ms
memory: 3600kb

input:

\x03

output:


result:

ok Correct

Test #49:

score: 0
Accepted
time: 55ms
memory: 3772kb

input:

!\x02

output:


result:

ok Correct

Test #50:

score: -5
Runtime Error

input:

\x02

output:


result:


Subtask #5:

score: 0
Runtime Error

Test #84:

score: 10
Accepted
time: 1ms
memory: 3540kb

input:

\x03

output:


result:

ok Correct

Test #85:

score: 0
Accepted
time: 72ms
memory: 3760kb

input:

!\x02

output:


result:

ok Correct

Test #86:

score: -10
Runtime Error

input:

\x02

output:


result:


Subtask #6:

score: 0
Runtime Error

Test #132:

score: 5
Accepted
time: 0ms
memory: 3596kb

input:

\x03

output:


result:

ok Correct

Test #133:

score: 0
Accepted
time: 39ms
memory: 3764kb

input:

!\x02

output:


result:

ok Correct

Test #134:

score: -5
Runtime Error

input:

\x02

output:


result:


Subtask #7:

score: 0
Runtime Error

Test #192:

score: 60
Accepted
time: 1ms
memory: 3600kb

input:

\x03

output:


result:

ok Correct

Test #193:

score: 0
Runtime Error

input:


output:


result: