QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#755408#9550. The Empressucup-team5243#AC ✓1ms3908kbC++173.1kb2024-11-16 17:15:172024-11-16 17:15:18

Judging History

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

  • [2024-11-16 17:15:18]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3908kb
  • [2024-11-16 17:15:17]
  • 提交

answer

#ifdef NACHIA
#define _GLIBCXX_DEBUG
#else
#define NDEBUG
#endif
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<int(n); i++)
const i64 INF = 1001001001001001001;
template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; }
template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; }
using namespace std;

void testcase(){
    i64 N; cin >> N;
    auto rec = [&](auto& rec, i64 N) -> pair<i64, vector<vector<i64>>> {
        if(N == 0){
            vector<vector<i64>> ans;
            ans.push_back({ -1, -1, 0, 0 });
            return { 0, ans };
        } if(N == 2){
            vector<vector<i64>> ans;
            ans.push_back({ 0, 1, 0, 0 });
            ans.push_back({ -1, -1, 0, 1 });
            return { 1, ans };
        } if(N == 6){
            vector<vector<i64>> ans;
            ans.push_back({ 0, 1, 0, 0 });
            ans.push_back({ 1, 2, 1, 0 });
            ans.push_back({ -1, -1, 0, 2 });
            return { 2, ans };
        } if(N == 4){
            vector<vector<i64>> ans;
            ans.push_back({ 0, 1, 0, 0 });
            ans.push_back({ 1, 2, 1, 1 });
            ans.push_back({ -1, -1, 0, 2 });
            return { 2, ans };
        }
        auto [z, f] = rec(rec, (N - 2) / 4 * 2);
        if(N % 4 == 0){
            for(auto& e : f){
                if(e[0] != -1) e[0] += 2;
                if(e[1] == z) e[1] = 1; else if(e[1] != -1) e[1] += 2;
                if(e[2] != -1) e[2] += 2;
                if(e[3] == z) e[3] = 1; if(e[3] != -1) e[3] += 2;
            }
            z += 2;
            f.insert(f.begin(), { 1, 0, 1, 2 });
            f.insert(f.begin(), { 0, z, 0, 2 });
        } else {
            for(auto& e : f){
                if(e[0] != -1) e[0] += 1;
                if(e[1] == z) e[1] = i64(f.size());
                if(e[2] != -1) e[2] += 1;
                if(e[3] == z) e[3] = i64(f.size());
            }
            f.insert(f.end(), { 0, z, 0, 0 });
        }
        return { z, f };
    };
    auto [z,ans] = rec(rec, N-1);
    //cout << "z = " << z << endl;
    cout << ans.size() << "\n";
    for(auto a : ans){
        if(a[0] == -1){
            cout << "HALT; ";
        } else {
            cout << "POP " << (a[0] + 1) << " GOTO " << (a[1] + 1) << "; ";
        }
        cout << "PUSH " << (a[2] + 1) << " GOTO " << (a[3] + 1) << "\n";
    }
    //vector<int> X;
    //int p = 0;
    //int cnt = 0;
    //while(true){
    //    cnt++;
    //    auto inst = ans[p];
    //    if(inst[0] == -1){
    //        if(X.empty()) break;
    //    } else {
    //        if(!X.empty() && X.back() == inst[0]){
    //            X.pop_back();
    //            p = inst[1];
    //            continue;
    //        }
    //    }
    //    X.push_back(inst[2]);
    //    p = inst[3];
    //}
    //cout << "cnt = " << cnt << endl;
}

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    testcase();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3792kb

input:

1

output:

1
HALT; PUSH 1 GOTO 1

result:

ok x=1

Test #2:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

5

output:

3
POP 1 GOTO 2; PUSH 1 GOTO 1
POP 2 GOTO 3; PUSH 2 GOTO 2
HALT; PUSH 1 GOTO 3

result:

ok x=5

Test #3:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

17

output:

5
POP 1 GOTO 5; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 4; PUSH 3 GOTO 3
POP 4 GOTO 2; PUSH 4 GOTO 3
HALT; PUSH 3 GOTO 4

result:

ok x=17

Test #4:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

19260817

output:

35
POP 1 GOTO 25; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 5 GOTO 34; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 9 GOTO 32; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 11 GOTO 6; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 14 GOTO 31; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
P...

result:

ok x=19260817

Test #5:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

1145141919

output:

40
POP 5 GOTO 37; PUSH 5 GOTO 3
POP 6 GOTO 1; PUSH 6 GOTO 3
POP 8 GOTO 36; PUSH 8 GOTO 5
POP 9 GOTO 3; PUSH 9 GOTO 5
POP 11 GOTO 35; PUSH 11 GOTO 7
POP 12 GOTO 5; PUSH 12 GOTO 7
POP 14 GOTO 34; PUSH 14 GOTO 9
POP 15 GOTO 7; PUSH 15 GOTO 9
POP 16 GOTO 8; PUSH 16 GOTO 11
POP 17 GOTO 9; PUSH 17 GOTO 11...

result:

ok x=1145141919

Test #6:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

2147483647

output:

31
POP 29 GOTO 2; PUSH 29 GOTO 1
POP 30 GOTO 4; PUSH 30 GOTO 1
HALT; PUSH 29 GOTO 4
POP 28 GOTO 5; PUSH 28 GOTO 1
POP 27 GOTO 6; PUSH 27 GOTO 1
POP 26 GOTO 7; PUSH 26 GOTO 1
POP 25 GOTO 8; PUSH 25 GOTO 1
POP 24 GOTO 9; PUSH 24 GOTO 1
POP 23 GOTO 10; PUSH 23 GOTO 1
POP 22 GOTO 11; PUSH 22 GOTO 1
POP ...

result:

ok x=2147483647

Test #7:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

1868665701

output:

46
POP 1 GOTO 33; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 7 GOTO 45; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 9 GOTO 6; PUSH 9 GOTO 9
POP 10 GOTO 7; PUSH 10 GOTO 9
POP 12 GOTO 44; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 14...

result:

ok x=1868665701

Test #8:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

2102547599

output:

43
POP 4 GOTO 41; PUSH 4 GOTO 3
POP 5 GOTO 1; PUSH 5 GOTO 3
POP 8 GOTO 39; PUSH 8 GOTO 5
POP 9 GOTO 3; PUSH 9 GOTO 5
POP 12 GOTO 37; PUSH 12 GOTO 7
POP 13 GOTO 5; PUSH 13 GOTO 7
POP 15 GOTO 36; PUSH 15 GOTO 9
POP 16 GOTO 7; PUSH 16 GOTO 9
POP 18 GOTO 35; PUSH 18 GOTO 11
POP 19 GOTO 9; PUSH 19 GOTO 1...

result:

ok x=2102547599

Test #9:

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

input:

2054530275

output:

46
POP 2 GOTO 46; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 6 GOTO 44; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 8 GOTO 4; PUSH 8 GOTO 7
POP 9 GOTO 5; PUSH 9 GOTO 7
POP 10 GOTO 6; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 14 GOTO 42; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
POP ...

result:

ok x=2054530275

Test #10:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

1953685475

output:

48
POP 2 GOTO 48; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 6 GOTO 46; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 8 GOTO 4; PUSH 8 GOTO 7
POP 9 GOTO 5; PUSH 9 GOTO 7
POP 10 GOTO 6; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 12 GOTO 8; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 1...

result:

ok x=1953685475

Test #11:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

2119017059

output:

45
POP 2 GOTO 45; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 6 GOTO 43; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 8 GOTO 4; PUSH 8 GOTO 7
POP 9 GOTO 5; PUSH 9 GOTO 7
POP 12 GOTO 41; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 17 GOTO 38; PUSH 17 GOTO 11
POP 18 GOTO 9; PUSH 18 GOTO 11
POP...

result:

ok x=2119017059

Test #12:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

1911337379

output:

45
POP 2 GOTO 45; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 6 GOTO 43; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 9 GOTO 42; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 11 GOTO 6; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 16 GOTO 39; PUSH 16 GOTO 11
POP 17 GOTO 9; PUSH 17 GOTO 11
P...

result:

ok x=1911337379

Test #13:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

887618459

output:

48
POP 2 GOTO 48; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 4 GOTO 2; PUSH 4 GOTO 5
POP 5 GOTO 3; PUSH 5 GOTO 5
POP 6 GOTO 4; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 10 GOTO 46; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 12 GOTO 8; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 1...

result:

ok x=887618459

Test #14:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

831117597

output:

43
POP 1 GOTO 29; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 5 GOTO 4; PUSH 5 GOTO 7
POP 6 GOTO 5; PUSH 6 GOTO 7
POP 7 GOTO 6; PUSH 7 GOTO 9
POP 8 GOTO 7; PUSH 8 GOTO 9
POP 12 GOTO 41; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 16 GO...

result:

ok x=831117597

Test #15:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

1820253559

output:

49
POP 3 GOTO 48; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 5 GOTO 2; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 7 GOTO 4; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 9 GOTO 6; PUSH 9 GOTO 9
POP 10 GOTO 7; PUSH 10 GOTO 9
POP 12 GOTO 47; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 15 ...

result:

ok x=1820253559

Test #16:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

1563399651

output:

47
POP 2 GOTO 47; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 6 GOTO 45; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 8 GOTO 4; PUSH 8 GOTO 7
POP 9 GOTO 5; PUSH 9 GOTO 7
POP 10 GOTO 6; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 12 GOTO 8; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 1...

result:

ok x=1563399651

Test #17:

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

input:

1631350977

output:

42
POP 1 GOTO 25; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 7 GOTO 39; PUSH 7 GOTO 5
POP 8 GOTO 3; PUSH 8 GOTO 5
POP 9 GOTO 4; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 15 GOTO 35; PUSH 15 GOTO 9
POP 16 GOTO 7; PUSH 16 GOTO 9
POP 17 GOTO 8; PUSH 17 GOTO 11
POP 18 GOTO 9; PUSH 18 GOTO 11
PO...

result:

ok x=1631350977

Test #18:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

1897574279

output:

44
POP 3 GOTO 43; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 8 GOTO 40; PUSH 8 GOTO 5
POP 9 GOTO 3; PUSH 9 GOTO 5
POP 10 GOTO 4; PUSH 10 GOTO 7
POP 11 GOTO 5; PUSH 11 GOTO 7
POP 12 GOTO 6; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 14 GOTO 8; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
P...

result:

ok x=1897574279

Test #19:

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

input:

450973351

output:

41
POP 3 GOTO 40; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 6 GOTO 39; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 9 GOTO 38; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 12 GOTO 37; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 14 GOTO 8; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
P...

result:

ok x=450973351

Test #20:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

1212949423

output:

40
POP 4 GOTO 38; PUSH 4 GOTO 3
POP 5 GOTO 1; PUSH 5 GOTO 3
POP 6 GOTO 2; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 9 GOTO 37; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 11 GOTO 6; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 13 GOTO 8; PUSH 13 GOTO 11
POP 14 GOTO 9; PUSH 14 GOTO 11
POP...

result:

ok x=1212949423

Test #21:

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

input:

1800664165

output:

47
POP 1 GOTO 35; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 7 GOTO 46; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 9 GOTO 6; PUSH 9 GOTO 9
POP 10 GOTO 7; PUSH 10 GOTO 9
POP 14 GOTO 43; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
POP 17...

result:

ok x=1800664165

Test #22:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

2083340735

output:

42
POP 6 GOTO 38; PUSH 6 GOTO 3
POP 7 GOTO 1; PUSH 7 GOTO 3
POP 8 GOTO 2; PUSH 8 GOTO 5
POP 9 GOTO 3; PUSH 9 GOTO 5
POP 10 GOTO 4; PUSH 10 GOTO 7
POP 11 GOTO 5; PUSH 11 GOTO 7
POP 17 GOTO 33; PUSH 17 GOTO 9
POP 18 GOTO 7; PUSH 18 GOTO 9
POP 20 GOTO 32; PUSH 20 GOTO 11
POP 21 GOTO 9; PUSH 21 GOTO 11
...

result:

ok x=2083340735

Test #23:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

1989353363

output:

46
POP 2 GOTO 46; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 5 GOTO 45; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 9 GOTO 43; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 11 GOTO 6; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 13 GOTO 8; PUSH 13 GOTO 11
POP 14 GOTO 9; PUSH 14 GOTO 11
PO...

result:

ok x=1989353363

Test #24:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

1686030751

output:

44
POP 5 GOTO 41; PUSH 5 GOTO 3
POP 6 GOTO 1; PUSH 6 GOTO 3
POP 8 GOTO 40; PUSH 8 GOTO 5
POP 9 GOTO 3; PUSH 9 GOTO 5
POP 10 GOTO 4; PUSH 10 GOTO 7
POP 11 GOTO 5; PUSH 11 GOTO 7
POP 14 GOTO 38; PUSH 14 GOTO 9
POP 15 GOTO 7; PUSH 15 GOTO 9
POP 18 GOTO 36; PUSH 18 GOTO 11
POP 19 GOTO 9; PUSH 19 GOTO 11...

result:

ok x=1686030751

Test #25:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

483234157

output:

43
POP 1 GOTO 31; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 5 GOTO 4; PUSH 5 GOTO 7
POP 6 GOTO 5; PUSH 6 GOTO 7
POP 8 GOTO 43; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 10 GOTO 8; PUSH 10 GOTO 11
POP 11 GOTO 9; PUSH 11 GOTO 11
POP 13 GO...

result:

ok x=483234157

Test #26:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

1784967647

output:

43
POP 5 GOTO 40; PUSH 5 GOTO 3
POP 6 GOTO 1; PUSH 6 GOTO 3
POP 7 GOTO 2; PUSH 7 GOTO 5
POP 8 GOTO 3; PUSH 8 GOTO 5
POP 9 GOTO 4; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 11 GOTO 6; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 16 GOTO 37; PUSH 16 GOTO 11
POP 17 GOTO 9; PUSH 17 GOTO 11
POP...

result:

ok x=1784967647

Test #27:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

1052131125

output:

48
POP 1 GOTO 39; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 48; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 12 GOTO 46; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 14 G...

result:

ok x=1052131125

Test #28:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

673034421

output:

42
POP 1 GOTO 28; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 42; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 11 GOTO 41; PUSH 11 GOTO 11
POP 12 GOTO 9; PUSH 12 GOTO 11
POP 17 G...

result:

ok x=673034421

Test #29:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

1136250939

output:

44
POP 2 GOTO 44; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 4 GOTO 2; PUSH 4 GOTO 5
POP 5 GOTO 3; PUSH 5 GOTO 5
POP 6 GOTO 4; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 16 GOTO 38; PUSH 16 GOTO 11
POP 17 GOTO 9; PUSH 17 GOTO 11
POP 19 GO...

result:

ok x=1136250939

Test #30:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

1434678339

output:

42
POP 2 GOTO 42; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 7 GOTO 39; PUSH 7 GOTO 5
POP 8 GOTO 3; PUSH 8 GOTO 5
POP 12 GOTO 36; PUSH 12 GOTO 7
POP 13 GOTO 5; PUSH 13 GOTO 7
POP 15 GOTO 35; PUSH 15 GOTO 9
POP 16 GOTO 7; PUSH 16 GOTO 9
POP 17 GOTO 8; PUSH 17 GOTO 11
POP 18 GOTO 9; PUSH 18 GOTO 11...

result:

ok x=1434678339

Test #31:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

174274079

output:

37
POP 5 GOTO 34; PUSH 5 GOTO 3
POP 6 GOTO 1; PUSH 6 GOTO 3
POP 10 GOTO 31; PUSH 10 GOTO 5
POP 11 GOTO 3; PUSH 11 GOTO 5
POP 12 GOTO 4; PUSH 12 GOTO 7
POP 13 GOTO 5; PUSH 13 GOTO 7
POP 15 GOTO 30; PUSH 15 GOTO 9
POP 16 GOTO 7; PUSH 16 GOTO 9
POP 17 GOTO 8; PUSH 17 GOTO 11
POP 18 GOTO 9; PUSH 18 GOTO...

result:

ok x=174274079

Test #32:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

1911998229

output:

47
POP 1 GOTO 35; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 47; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 11 GOTO 44; PUSH 11 GOTO 9
POP 12 GOTO 7; PUSH 12 GOTO 9
POP 13 GOTO 8; PUSH 13 GOTO 11
POP 14 GOTO 9; PUSH 14 GOTO 11
POP ...

result:

ok x=1911998229

Test #33:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

441665295

output:

39
POP 4 GOTO 37; PUSH 4 GOTO 3
POP 5 GOTO 1; PUSH 5 GOTO 3
POP 9 GOTO 34; PUSH 9 GOTO 5
POP 10 GOTO 3; PUSH 10 GOTO 5
POP 11 GOTO 4; PUSH 11 GOTO 7
POP 12 GOTO 5; PUSH 12 GOTO 7
POP 13 GOTO 6; PUSH 13 GOTO 9
POP 14 GOTO 7; PUSH 14 GOTO 9
POP 18 GOTO 31; PUSH 18 GOTO 11
POP 19 GOTO 9; PUSH 19 GOTO 1...

result:

ok x=441665295

Test #34:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

1325107907

output:

46
POP 2 GOTO 46; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 7 GOTO 43; PUSH 7 GOTO 5
POP 8 GOTO 3; PUSH 8 GOTO 5
POP 9 GOTO 4; PUSH 9 GOTO 7
POP 10 GOTO 5; PUSH 10 GOTO 7
POP 12 GOTO 42; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 15 GOTO 41; PUSH 15 GOTO 11
POP 16 GOTO 9; PUSH 16 GOTO 11
P...

result:

ok x=1325107907

Test #35:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

264691101

output:

45
POP 1 GOTO 37; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 5 GOTO 4; PUSH 5 GOTO 7
POP 6 GOTO 5; PUSH 6 GOTO 7
POP 7 GOTO 6; PUSH 7 GOTO 9
POP 8 GOTO 7; PUSH 8 GOTO 9
POP 11 GOTO 44; PUSH 11 GOTO 11
POP 12 GOTO 9; PUSH 12 GOTO 11
POP 13 GO...

result:

ok x=264691101

Test #36:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

1655988757

output:

42
POP 1 GOTO 25; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 42; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 12 GOTO 38; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 17 GOTO 35; PUSH 17 GOTO 11
POP 18 GOTO 9; PUSH 18 GOTO 11
POP...

result:

ok x=1655988757

Test #37:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

1912613857

output:

41
POP 1 GOTO 23; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 6 GOTO 39; PUSH 6 GOTO 5
POP 7 GOTO 3; PUSH 7 GOTO 5
POP 8 GOTO 4; PUSH 8 GOTO 7
POP 9 GOTO 5; PUSH 9 GOTO 7
POP 10 GOTO 6; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 12 GOTO 8; PUSH 12 GOTO 11
POP 13 GOTO 9; PUSH 13 GOTO 11
POP 1...

result:

ok x=1912613857

Test #38:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

471758205

output:

45
POP 1 GOTO 35; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 5 GOTO 4; PUSH 5 GOTO 7
POP 6 GOTO 5; PUSH 6 GOTO 7
POP 7 GOTO 6; PUSH 7 GOTO 9
POP 8 GOTO 7; PUSH 8 GOTO 9
POP 9 GOTO 8; PUSH 9 GOTO 11
POP 10 GOTO 9; PUSH 10 GOTO 11
POP 11 GOTO ...

result:

ok x=471758205

Test #39:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

1295394655

output:

43
POP 5 GOTO 40; PUSH 5 GOTO 3
POP 6 GOTO 1; PUSH 6 GOTO 3
POP 7 GOTO 2; PUSH 7 GOTO 5
POP 8 GOTO 3; PUSH 8 GOTO 5
POP 10 GOTO 39; PUSH 10 GOTO 7
POP 11 GOTO 5; PUSH 11 GOTO 7
POP 12 GOTO 6; PUSH 12 GOTO 9
POP 13 GOTO 7; PUSH 13 GOTO 9
POP 14 GOTO 8; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
P...

result:

ok x=1295394655

Test #40:

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

input:

1734993785

output:

49
POP 1 GOTO 39; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 4 GOTO 49; PUSH 4 GOTO 5
POP 5 GOTO 3; PUSH 5 GOTO 5
POP 6 GOTO 4; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 10 GOTO 8; PUSH 10 GOTO 11
POP 11 GOTO 9; PUSH 11 GOTO 11
POP 13 GO...

result:

ok x=1734993785

Test #41:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

986893495

output:

44
POP 3 GOTO 43; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 5 GOTO 2; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 7 GOTO 4; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 10 GOTO 42; PUSH 10 GOTO 9
POP 11 GOTO 7; PUSH 11 GOTO 9
POP 14 GOTO 40; PUSH 14 GOTO 11
POP 15 GOTO 9; PUSH 15 GOTO 11
POP ...

result:

ok x=986893495

Test #42:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

105826293

output:

42
POP 1 GOTO 33; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 42; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 10 GOTO 8; PUSH 10 GOTO 11
POP 11 GOTO 9; PUSH 11 GOTO 11
POP 12 GO...

result:

ok x=105826293

Test #43:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

3

output:

2
POP 1 GOTO 2; PUSH 1 GOTO 1
HALT; PUSH 1 GOTO 2

result:

ok x=3

Test #44:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

7

output:

3
POP 1 GOTO 2; PUSH 1 GOTO 1
POP 2 GOTO 3; PUSH 2 GOTO 1
HALT; PUSH 1 GOTO 3

result:

ok x=7

Test #45:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

9

output:

4
POP 1 GOTO 4; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 3
HALT; PUSH 3 GOTO 4

result:

ok x=9

Test #46:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

11

output:

4
POP 2 GOTO 2; PUSH 2 GOTO 1
POP 3 GOTO 4; PUSH 3 GOTO 2
HALT; PUSH 2 GOTO 4
POP 1 GOTO 3; PUSH 1 GOTO 1

result:

ok x=11

Test #47:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

13

output:

5
POP 1 GOTO 5; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 4; PUSH 3 GOTO 3
POP 4 GOTO 2; PUSH 4 GOTO 4
HALT; PUSH 3 GOTO 4

result:

ok x=13

Test #48:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

15

output:

4
POP 2 GOTO 2; PUSH 2 GOTO 1
POP 3 GOTO 4; PUSH 3 GOTO 1
HALT; PUSH 2 GOTO 4
POP 1 GOTO 3; PUSH 1 GOTO 1

result:

ok x=15

Test #49:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

2147483643

output:

58
POP 2 GOTO 58; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 4 GOTO 2; PUSH 4 GOTO 5
POP 5 GOTO 3; PUSH 5 GOTO 5
POP 6 GOTO 4; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 10 GOTO 8; PUSH 10 GOTO 11
POP 11 GOTO 9; PUSH 11 GOTO 11
POP 12 GOT...

result:

ok x=2147483643

Test #50:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

2147483645

output:

59
POP 1 GOTO 59; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 5 GOTO 4; PUSH 5 GOTO 7
POP 6 GOTO 5; PUSH 6 GOTO 7
POP 7 GOTO 6; PUSH 7 GOTO 9
POP 8 GOTO 7; PUSH 8 GOTO 9
POP 9 GOTO 8; PUSH 9 GOTO 11
POP 10 GOTO 9; PUSH 10 GOTO 11
POP 11 GOTO ...

result:

ok x=2147483645

Test #51:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

1073741827

output:

31
POP 2 GOTO 31; PUSH 2 GOTO 3
POP 3 GOTO 1; PUSH 3 GOTO 3
POP 29 GOTO 4; PUSH 29 GOTO 3
POP 30 GOTO 6; PUSH 30 GOTO 3
HALT; PUSH 29 GOTO 6
POP 28 GOTO 7; PUSH 28 GOTO 3
POP 27 GOTO 8; PUSH 27 GOTO 3
POP 26 GOTO 9; PUSH 26 GOTO 3
POP 25 GOTO 10; PUSH 25 GOTO 3
POP 24 GOTO 11; PUSH 24 GOTO 3
POP 23 ...

result:

ok x=1073741827

Test #52:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1073741825

output:

31
POP 1 GOTO 5; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 29 GOTO 4; PUSH 29 GOTO 3
POP 30 GOTO 6; PUSH 30 GOTO 3
HALT; PUSH 29 GOTO 6
POP 28 GOTO 7; PUSH 28 GOTO 3
POP 27 GOTO 8; PUSH 27 GOTO 3
POP 26 GOTO 9; PUSH 26 GOTO 3
POP 25 GOTO 10; PUSH 25 GOTO 3
POP 24 GOTO 11; PUSH 24 GOTO 3
POP 23 G...

result:

ok x=1073741825

Test #53:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

1073741823

output:

30
POP 28 GOTO 2; PUSH 28 GOTO 1
POP 29 GOTO 4; PUSH 29 GOTO 1
HALT; PUSH 28 GOTO 4
POP 27 GOTO 5; PUSH 27 GOTO 1
POP 26 GOTO 6; PUSH 26 GOTO 1
POP 25 GOTO 7; PUSH 25 GOTO 1
POP 24 GOTO 8; PUSH 24 GOTO 1
POP 23 GOTO 9; PUSH 23 GOTO 1
POP 22 GOTO 10; PUSH 22 GOTO 1
POP 21 GOTO 11; PUSH 21 GOTO 1
POP ...

result:

ok x=1073741823

Test #54:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

536870967

output:

32
POP 3 GOTO 31; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 5 GOTO 2; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 7 GOTO 4; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 30 GOTO 8; PUSH 30 GOTO 7
POP 31 GOTO 10; PUSH 31 GOTO 7
HALT; PUSH 30 GOTO 10
POP 29 GOTO 11; PUSH 29 GOTO 7
POP 28 GOTO 12...

result:

ok x=536870967

Test #55:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

536870965

output:

33
POP 1 GOTO 11; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 33; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 31 GOTO 10; PUSH 31 GOTO 9
POP 32 GOTO 12; PUSH 32 GOTO 9
HALT; PUS...

result:

ok x=536870965

Test #56:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1073741881

output:

34
POP 1 GOTO 11; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 4 GOTO 34; PUSH 4 GOTO 5
POP 5 GOTO 3; PUSH 5 GOTO 5
POP 6 GOTO 4; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 32 GOTO 10; PUSH 32 GOTO 9
POP 33 GOTO 12; PUSH 33 GOTO 9
HALT; PUS...

result:

ok x=1073741881

Test #57:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1073741879

output:

33
POP 3 GOTO 32; PUSH 3 GOTO 3
POP 4 GOTO 1; PUSH 4 GOTO 3
POP 5 GOTO 2; PUSH 5 GOTO 5
POP 6 GOTO 3; PUSH 6 GOTO 5
POP 7 GOTO 4; PUSH 7 GOTO 7
POP 8 GOTO 5; PUSH 8 GOTO 7
POP 31 GOTO 8; PUSH 31 GOTO 7
POP 32 GOTO 10; PUSH 32 GOTO 7
HALT; PUSH 31 GOTO 10
POP 30 GOTO 11; PUSH 30 GOTO 7
POP 29 GOTO 12...

result:

ok x=1073741879

Test #58:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

1073741877

output:

34
POP 1 GOTO 11; PUSH 1 GOTO 3
POP 2 GOTO 1; PUSH 2 GOTO 3
POP 3 GOTO 2; PUSH 3 GOTO 5
POP 4 GOTO 3; PUSH 4 GOTO 5
POP 6 GOTO 34; PUSH 6 GOTO 7
POP 7 GOTO 5; PUSH 7 GOTO 7
POP 8 GOTO 6; PUSH 8 GOTO 9
POP 9 GOTO 7; PUSH 9 GOTO 9
POP 32 GOTO 10; PUSH 32 GOTO 9
POP 33 GOTO 12; PUSH 33 GOTO 9
HALT; PUS...

result:

ok x=1073741877

Extra Test:

score: 0
Extra Test Passed