QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131663#2674. Vision programsomethingnew#32 90ms11404kbC++207.4kb2023-07-27 20:03:252024-07-04 01:00:04

Judging History

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

  • [2024-07-04 01:00:04]
  • 评测
  • 测评结果:32
  • 用时:90ms
  • 内存:11404kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-27 20:03:25]
  • 提交

answer

//  ↘ ⬇ ⬇ ⬇ ⬇ ⬇ ↙
//  ➡ @roadfromroi ⬅
//  ↗ ⬆ ⬆ ⬆ ⬆ ⬆ ↖
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#include "vision.h"
#include "random"
#define all(x) x.begin(), x.end()
using namespace std;
vector<int> getka(int n, int m) {
    int res = 0;
    vector<int> capa(n + m + 1);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            vector<int> beb(n + m + 1);
            for (int i1 = i; i1 < n; ++i1) {
                for (int j1 = j+1; j1 < m; ++j1) {
                    if (beb[abs(i-i1) + abs(j-j1)] == 0) {
                        capa[abs(i - i1) + abs(j - j1)]++;
                        beb[abs(i-i1) + abs(j-j1)] = 1;
                    }
                }
            }
        }
    }
    return capa;
}
int cn1, cn2;
int my_and(vector<int> a) {
    cn2 += a.size();
    cn1 += 1;
    return add_and(a);
}
int my_or(vector<int> &a) {
    cn2 += a.size();
    cn1 += 1;
    return add_or(a);
}
mt19937 rnd;
vector<int> toans;
vector<vector<int>> druz;
void genshin(int H, int W, int prob) {
    vector<int> op1, op2;
    vector<int> typp(H * W, 2);
    for (int i = 0; i < H * W; ++i) {
        if (rnd() % prob == 0) {
            typp[i] = 1;
            op1.push_back(i);
        }
    }
    for (int i = 0; i < H * W; ++i) {
        if (typp[i] == 1) {
            for (auto j : druz[i]) {
                if (typp[j] == 2)
                    typp[j] = 0;
            }
        }
    }
    //if (typp[0] + typp[1] == 3)
    //    cout << "DA\n";
    for (int i = 0; i < H * W; ++i) {
        if (typp[i] == 2) {
            op2.push_back(i);
        }
    }
    if (op1.empty() or op2.empty())
        return;
    int x = my_or(op1);
    int y = my_or(op2);
    int res = my_and(vector<int>{x, y});
    toans.push_back(res);
}
void construct_network(int H, int W, int K) {
    druz.assign(H * W, {});
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            for (int i1 = 0; i1 < H; ++i1) {
                for (int j1 = 0; j1 < W; ++j1) {
                    if (abs(i - i1) + abs(j - j1) == K) {
                        druz[i * W + j].push_back(i1 * W + j1);
                    }
                }
            }
        }
    }
    toans.clear();
    cn1 = 0;cn2 = 0;
    int ctry = 0;
    while (cn2 + toans.size() < 960000 and cn1 < 9990 and ctry * H * W < 5e5) {
        genshin(H, W, K * 4);
        ctry++;
    }
    if (toans.empty()) {
        vector<int> t;
        for (int i = 0; i < H * W; ++i) {
            t.push_back(i);
        }
        int beba = my_or(t);
    } else {
        int beba = my_or(toans);
        beba = add_not(beba);
    }
    //cout << toans.size() << ' ' << cn1 << ' ' << cn2 << endl;
}
//#define LOCAL
#ifdef LOCAL

static const int MAX_INSTRUCTIONS = 10000;
static const int MAX_INPUTS = 1000000;

static const int _AND = 0;
static const int _OR = 1;
static const int _XOR = 2;
static const int _NOT = 3;

static inline bool increasing(int a, int b, int c) {
    return a <= b && b <= c;
}

[[noreturn]] static inline void error(string message) {
    printf("%s\n", message.c_str());
    exit(0);
}

class InstructionNetwork {

    struct Instruction {
        int type;
        vector<int> input_indexes;

        inline Instruction(int _type, const vector<int>& _input_indexes):
                type(_type), input_indexes(_input_indexes) {
        }

        inline int apply(int a, int b) const {
            switch (type) {
                case _AND:
                    return a & b;
                case _OR:
                    return a | b;
                case _XOR:
                    return a ^ b;
                default:
                    return 0;
            }
        }

        inline int compute(const vector<int>& memory_cells) const {
            int r = memory_cells[input_indexes[0]];
            if (type == _NOT)
                return 1 - r;
            for (int j = 1; j < (int)input_indexes.size(); j++)
                r = apply(r, memory_cells[input_indexes[j]]);
            return r;
        }
    };

    int input_size;
    int total_inputs;
    vector<Instruction> instructions;

public:

    inline void init(int _input_size) {
        this->input_size = _input_size;
        this->total_inputs = 0;
        this->instructions.clear();
    }

    inline int add_instruction(int type, const vector<int>& input_indexes) {
        if (input_indexes.size() == 0)
            error("Instruction with no inputs");

        if (instructions.size() + 1 > MAX_INSTRUCTIONS)
            error("Too many instructions");

        if (total_inputs + input_indexes.size() > MAX_INPUTS)
            error("Too many inputs");

        instructions.emplace_back(type, input_indexes);
        total_inputs += input_indexes.size();
        int new_index = input_size + (int)instructions.size() - 1;

        for (int input_index : input_indexes)
            if (!increasing(0, input_index, new_index-1))
                error("Invalid index");

        return new_index;
    }

    inline int compute(vector<int> &memory_cells) const {
        for (auto &instruction : instructions)
            memory_cells.push_back(instruction.compute(memory_cells));
        return memory_cells.back();
    }
};


static InstructionNetwork instructionNetwork;

int main() {
    int H, W, K;
    assert(3 == scanf("%d%d%d", &H, &W, &K));

    FILE *log_file = fopen("log.txt","w");

    instructionNetwork.init(H * W);
    construct_network(H, W, K);

    while (true) {
        int rowA, colA, rowB, colB;
        assert(1 == scanf("%d", &rowA));
        if (rowA == -1)
            break;
        assert(3 == scanf("%d%d%d", &colA, &rowB, &colB));

        if ((!increasing(0, rowA, H-1)) ||
            (!increasing(0, colA, W-1)) ||
            (!increasing(0, rowB, H-1)) ||
            (!increasing(0, colB, W-1)) ||
            (rowA == rowB && colA == colB)) {
            printf("-1\n");
            fprintf(log_file, "-1\n");
            fflush(stdout);
            fflush(log_file);
            continue;
        }

        vector<int> memory_cells;
        for (int row = 0; row < H; row++)
            for (int col = 0; col < W; col++) {
                bool active = (row == rowA && col == colA) || (row == rowB && col == colB);
                memory_cells.push_back(active ? 1 : 0);
            }
        int computation_result = instructionNetwork.compute(memory_cells);

        printf("%d\n", computation_result);
        fflush(stdout);

        for(int i = 0; i < (int)memory_cells.size(); i++)
            fprintf(log_file, (i ? " %d" : "%d"), memory_cells[i]);
        fprintf(log_file, "\n");
        fflush(log_file);
    }
    fclose(stdin);
}

int add_and(vector<int> Ns) {
    return instructionNetwork.add_instruction(_AND, Ns);
}

int add_or(vector<int> Ns) {
    return instructionNetwork.add_instruction(_OR, Ns);
}

int add_xor(vector<int> Ns) {
    return instructionNetwork.add_instruction(_XOR, Ns);
}

int add_not(int N) {
    vector<int> Ns = {N};
    return instructionNetwork.add_instruction(_NOT, Ns);
}
#endif

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 4ms
memory: 4124kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 3 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 2
0 2 3 4
1 1 0
1 1 2
0 2 6 7
1 1 2
1 1 0
0 2 9 10
1 1 0
1 1 2
0 2 12 13
1 1 0
1 1 2
0 2 15 16
1 1 2
1 1 0
0 2 18 19
1 1 2
1 1 0
0 2 21 22
1 1 2
1 1 0
0 2 24 25
1 1 2
1 1 0
0 2 27 28
1 1 2
1 1 0
0 2 30 31
1 1 0
1 1 2
0 2 33 34
1 1 2
1 1 0
0 2 36...

result:

ok 

Test #2:

score: 0
Accepted
time: 4ms
memory: 4216kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 3 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 1
0 2 3 4
1 1 2
1 1 1
0 2 6 7
1 1 0
1 1 1
0 2 9 10
1 1 1
1 2 0 2
0 2 12 13
1 1 2
1 1 1
0 2 15 16
1 1 1
1 2 0 2
0 2 18 19
1 1 1
1 2 0 2
0 2 21 22
1 1 2
1 1 1
0 2 24 25
1 1 2
1 1 1
0 2 27 28
1 1 0
1 1 1
0 2 30 31
1 1 2
1 1 1
0 2 33 34
1 1 2
1 1 1
...

result:

ok 

Test #3:

score: 0
Accepted
time: 4ms
memory: 4120kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 1 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 2
0 2 3 4
1 1 0
1 1 2
0 2 6 7
1 1 2
1 1 0
0 2 9 10
1 1 0
1 1 2
0 2 12 13
1 1 0
1 1 2
0 2 15 16
1 1 2
1 1 0
0 2 18 19
1 1 2
1 1 0
0 2 21 22
1 1 2
1 1 0
0 2 24 25
1 1 2
1 1 0
0 2 27 28
1 1 2
1 1 0
0 2 30 31
1 1 0
1 1 2
0 2 33 34
1 1 2
1 1 0
0 2 36...

result:

ok 

Test #4:

score: 0
Accepted
time: 4ms
memory: 4060kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 1 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 1
0 2 3 4
1 1 2
1 1 1
0 2 6 7
1 1 0
1 1 1
0 2 9 10
1 1 1
1 2 0 2
0 2 12 13
1 1 2
1 1 1
0 2 15 16
1 1 1
1 2 0 2
0 2 18 19
1 1 1
1 2 0 2
0 2 21 22
1 1 2
1 1 1
0 2 24 25
1 1 2
1 1 1
0 2 27 28
1 1 0
1 1 1
0 2 30 31
1 1 2
1 1 1
0 2 33 34
1 1 2
1 1 1
...

result:

ok 

Test #5:

score: 0
Accepted
time: 4ms
memory: 4144kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 3
0 2 4 5
1 1 0
1 1 3
0 2 7 8
1 1 1
1 1 2
0 2 10 11
1 1 2
1 1 1
0 2 13 14
1 1 3
1 1 0
0 2 16 17
1 1 1
1 1 2
0 2 19 20
1 1 0
1 1 3
0 2 22 23
1 1 0
1 1 3
0 2 25 26
1 1 3
1 1 0
0 2 28 29
1 1 3
1 1 0
0 2 31 32
1 1 3
1 1 0
0 2 34 35
1 1 2
1 1 1
0 2 3...

result:

ok 

Test #6:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 3
1 2 1 2
0 2 4 5
1 1 2
1 2 0 3
0 2 7 8
1 1 3
1 2 1 2
0 2 10 11
1 1 3
1 2 1 2
0 2 13 14
1 1 3
1 2 1 2
0 2 16 17
1 1 0
1 2 1 2
0 2 19 20
1 1 0
1 2 1 2
0 2 22 23
1 1 3
1 2 1 2
0 2 25 26
1 1 3
1 2 1 2
0 2 28 29
1 1 2
1 2 0 3
0 2 31 32
1 1 0
1 2 1 2
0 2 3...

result:

ok 

Test #7:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 3 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 0 4
1 1 2
0 2 6 7
1 2 2 4
1 1 0
0 2 9 10
1 1 0
1 3 2 4 5
0 2 12 13
1 2 3 4
1 1 2
0 2 15 16
1 2 1 3
1 1 5
0 2 18 19
1 1 4
1 2 0 2
0 2 21 22
1 1 2
1 3 0 3 4
0 2 24 25
1 2 3 4
1 1 2
0 2 27 28
1 2 0 1
1 1 5
0 2 30 31
1 1 5
1 3 0 1 3
0 2 33 34
1 1 4
1 2 0 ...

result:

ok 

Test #8:

score: 0
Accepted
time: 4ms
memory: 4404kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 3 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 3
1 3 0 2 4
0 2 6 7
1 1 2
1 3 1 3 5
0 2 9 10
1 1 3
1 3 0 2 4
0 2 12 13
1 1 1
1 3 0 2 4
0 2 15 16
1 1 5
1 3 0 2 4
0 2 18 19
1 1 1
1 3 0 2 4
0 2 21 22
1 1 4
1 3 1 3 5
0 2 24 25
1 1 5
1 3 0 2 4
0 2 27 28
1 1 5
1 3 0 2 4
0 2 30 31
1 1 3
1 3 0 2 4
0 2 33 3...

result:

ok 

Test #9:

score: 0
Accepted
time: 4ms
memory: 4188kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 3 3
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 0 3
1 2 1 4
0 2 6 7
1 1 0
1 4 1 2 3 4
0 2 9 10
1 2 3 4
1 3 0 1 5
0 2 12 13
1 2 1 3
1 3 0 4 5
0 2 15 16
1 1 4
1 5 0 1 2 3 5
0 2 18 19
1 1 1
1 5 0 2 3 4 5
0 2 21 22
1 1 4
1 5 0 1 2 3 5
0 2 24 25
1 1 3
1 4 0 1 4 5
0 2 27 28
1 2 3 5
1 2 1 4
0 2 30 31
1 1 ...

result:

ok 

Test #10:

score: 0
Accepted
time: 4ms
memory: 4124kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 2 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 0 4
1 1 3
0 2 6 7
1 2 2 4
1 1 1
0 2 9 10
1 1 0
1 3 3 4 5
0 2 12 13
1 2 3 4
1 1 0
0 2 15 16
1 2 1 3
1 1 4
0 2 18 19
1 1 4
1 3 0 1 3
0 2 21 22
1 1 2
1 2 1 5
0 2 24 25
1 2 3 4
1 1 0
0 2 27 28
1 2 0 1
1 2 4 5
0 2 30 31
1 1 5
1 3 0 1 2
0 2 33 34
1 1 4
1 3 ...

result:

ok 

Test #11:

score: 0
Accepted
time: 4ms
memory: 4152kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 2 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 3
1 3 1 2 5
0 2 6 7
1 1 2
1 3 0 3 4
0 2 9 10
1 1 3
1 3 1 2 5
0 2 12 13
1 1 1
1 3 0 3 4
0 2 15 16
1 2 3 4
1 3 1 2 5
0 2 18 19
1 1 5
1 3 0 3 4
0 2 21 22
1 1 1
1 3 0 3 4
0 2 24 25
1 1 4
1 3 1 2 5
0 2 27 28
1 1 5
1 3 0 3 4
0 2 30 31
1 1 5
1 3 0 3 4
0 2 33...

result:

ok 

Test #12:

score: 0
Accepted
time: 4ms
memory: 4148kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 2 3
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 0 3
1 3 1 2 4
0 2 6 7
1 1 0
1 4 1 2 3 4
0 2 9 10
1 2 3 4
1 3 0 2 5
0 2 12 13
1 2 1 3
1 3 0 2 5
0 2 15 16
1 1 4
1 4 0 2 3 5
0 2 18 19
1 1 1
1 4 0 2 3 5
0 2 21 22
1 1 4
1 4 0 2 3 5
0 2 24 25
1 1 3
1 5 0 1 2 4 5
0 2 27 28
1 2 3 5
1 3 1 2 4
0 2 30 31
1 1 ...

result:

ok 

Test #13:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 3 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 0 4
1 3 2 6 8
0 2 9 10
1 3 3 6 8
1 2 1 2
0 2 12 13
1 1 8
1 6 0 1 2 3 4 6
0 2 15 16
1 2 1 3
1 3 5 7 8
0 2 18 19
1 3 3 4 7
1 1 2
0 2 21 22
1 2 0 7
1 2 2 5
0 2 24 25
1 1 2
1 6 0 3 4 6 7 8
0 2 27 28
1 4 0 1 3 4
1 1 8
0 2 30 31
1 3 5 6 7
1 2 0 1
0 2 33 34
...

result:

ok 

Test #14:

score: 0
Accepted
time: 4ms
memory: 4148kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 3 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 6
1 5 1 2 3 5 7
0 2 9 10
1 1 8
1 5 0 1 3 5 7
0 2 12 13
1 2 3 7
1 5 0 2 4 6 8
0 2 15 16
1 2 0 1
1 1 8
0 2 18 19
1 2 5 7
1 5 0 2 4 6 8
0 2 21 22
1 1 7
1 5 0 2 4 6 8
0 2 24 25
1 2 5 8
1 1 0
0 2 27 28
1 2 0 8
1 4 1 3 5 7
0 2 30 31
1 1 3
1 5 0 2 4 6 8
0 2 ...

result:

ok 

Test #15:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 3 3
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 3 6
1 3 0 4 7
0 2 9 10
1 1 3
1 6 0 1 4 5 6 7
0 2 12 13
1 3 3 4 7
1 3 1 5 6
0 2 15 16
1 1 0
1 6 1 2 3 4 6 8
0 2 18 19
1 2 1 4
1 5 0 2 3 5 7
0 2 21 22
1 1 7
1 6 1 3 4 5 6 8
0 2 24 25
1 3 0 6 8
1 2 2 4
0 2 27 28
1 3 5 7 8
1 1 4
0 2 30 31
1 1 2
1 6 0 1 4 ...

result:

ok 

Test #16:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 3 4
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 6
1 7 0 1 3 4 5 7 8
0 2 9 10
1 1 7
1 8 0 1 2 3 4 5 6 8
0 2 12 13
1 2 0 1
1 6 2 3 4 5 6 7
0 2 15 16
1 2 0 8
1 7 1 2 3 4 5 6 7
0 2 18 19
1 1 2
1 7 0 1 3 4 5 7 8
0 2 21 22
1 2 1 2
1 6 0 3 4 5 7 8
0 2 24 25
1 2 2 6
1 7 0 1 3 4 5 7 8
0 2 27 28
1 1 2
1 7 0 ...

result:

ok 

Test #17:

score: 0
Accepted
time: 15ms
memory: 4060kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 2 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1
1 2 0 1

result:

ok 

Test #18:

score: 0
Accepted
time: 15ms
memory: 3860kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 1 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1
1 2 0 1

result:

ok 

Subtask #2:

score: 11
Accepted

Test #19:

score: 11
Accepted
time: 5ms
memory: 4168kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 9 3
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 3 6
1 6 1 2 4 5 7 8
0 2 9 10
1 1 3
1 6 1 2 4 5 7 8
0 2 12 13
1 3 3 4 7
1 3 2 5 8
0 2 15 16
1 1 0
1 7 1 2 4 5 6 7 8
0 2 18 19
1 2 1 4
1 6 0 2 3 5 6 8
0 2 21 22
1 1 7
1 7 0 1 2 3 5 6 8
0 2 24 25
1 3 0 6 8
1 4 1 2 4 7
0 2 27 28
1 3 5 7 8
1 4 0 1 3 6
0 2 ...

result:

ok 

Test #20:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
9 1 5
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 3 6
1 5 0 2 4 5 7
0 2 9 10
1 1 1
1 7 0 2 3 4 5 7 8
0 2 12 13
1 1 7
1 7 0 1 3 4 5 6 8
0 2 15 16
1 1 7
1 7 0 1 3 4 5 6 8
0 2 18 19
1 1 5
1 7 1 2 3 4 6 7 8
0 2 21 22
1 2 2 7
1 7 0 1 3 4 5 6 8
0 2 24 25
1 1 8
1 7 0 1 2 4 5 6 7
0 2 27 28
1 1 6
1 7 0 2 3 4 ...

result:

ok 

Test #21:

score: 0
Accepted
time: 10ms
memory: 4644kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 5 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 4 15 26 39 43
1 28 0 1 2 3 4 6 7 8 9 10 12 13 14 18 19 23 24 27 31 34 35 38 40 42 44 45 46 48
0 2 50 51
1 8 13 14 27 29 38 45 48 49
1 13 0 1 2 5 6 10 15 16 20 22 26 30 40
0 2 53 54
1 5 7 10 13 15 16
1 28 2 4 8 14 24 27 28 29 30 31 32 33 34 35 36 37 38 3...

result:

ok 

Test #22:

score: 0
Accepted
time: 12ms
memory: 4772kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
5 10 12
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 15 43
1 48 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49
0 2 50 51
1 2 14 49
1 46 0 2 3 4 5 6 7 8 9 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ...

result:

ok 

Test #23:

score: 0
Accepted
time: 17ms
memory: 4784kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 10 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 27 0 4 12 15 17 26 28 30 39 40 43 45 52 56 63 64 66 67 77 78 79 83 88 91 95 98 99
1 22 6 8 9 19 21 23 24 32 34 37 47 48 58 59 60 61 70 71 72 75 80 86
0 2 100 101
1 23 5 7 10 13 14 15 16 19 32 33 38 43 51 65 71 72 73 74 77 82 86 91 92
1 29 1 2 21 27 30 3...

result:

ok 

Test #24:

score: 0
Accepted
time: 16ms
memory: 4792kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 10 5
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 9 12 15 28 43 52 77 83 88 98
1 32 0 3 7 8 16 18 19 22 25 30 31 39 41 50 58 61 64 68 70 73 76 79 81 85 86 87 89 90 92 95 96 99
0 2 100 101
1 6 5 19 32 43 77 82
1 49 1 3 6 7 8 9 10 12 13 16 17 18 21 23 24 29 30 31 34 35 39 40 42 51 52 53 56 59 61 62 67 68...

result:

ok 

Test #25:

score: 0
Accepted
time: 8ms
memory: 5012kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 10 9
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 3 39 88 99
1 71 0 1 2 4 5 6 8 10 11 13 14 15 17 19 20 22 23 24 26 28 29 31 32 33 35 37 38 40 42 44 46 47 48 49 50 51 53 55 56 57 58 59 60 62 64 65 66 67 68 69 71 73 75 76 77 78 79 80 82 83 84 86 87 89 91 92 93 94 95 97 98
0 2 100 101
1 6 5 13 15 16 43 8...

result:

ok 

Test #26:

score: 0
Accepted
time: 19ms
memory: 5588kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 10 14
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 4 15 64 95 99
1 90 1 2 3 5 6 7 8 9 10 11 12 14 16 17 18 19 20 21 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 39 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88...

result:

ok 

Test #27:

score: 0
Accepted
time: 16ms
memory: 5372kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 10 18
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 3 39 88 99
1 96 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...

result:

ok 

Subtask #3:

score: 11
Accepted

Dependency #2:

100%
Accepted

Test #28:

score: 11
Accepted
time: 21ms
memory: 5156kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 15
100 198
292 896
132 11
161 406
319 701
460 596
369 959
191 730
128 923
590 1006
31 451
230 575
143 515
149 571
73 554
699 559
302 658
455 1017
252 283
137 380
159 965
260 639
46 527
332 968
57 457
439 686
320 339
157 358
696 620
727 1022
623 949
35 609
7...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1670
1 20 12 15 43 88 105 119 143 182 205 262 293 310 462 465 532 694 725 747 760 872
1 489 1 2 4 6 7 8 9 10 13 14 18 19 20 21 22 23 24 25 26 28 30 33 35 36 37 38 39 40 47 48 49 50 51 52 53 54 55 57 60 64 65 66 67 68 69 71 72 76 78 79 80 81 83 84 86 91 94 95 9...

result:

ok 

Test #29:

score: 0
Accepted
time: 9ms
memory: 4428kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 29 15
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 2 12 15
1 25 1 2 3 4 5 6 7 8 9 10 11 13 14 16 17 18 19 20 21 22 23 24 25 26 28
0 2 29 30
1 1 14
1 28 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28
0 2 32 33
1 2 1 18
1 25 0 2 4 5 6 7 8 9 10 11 12 13 14 15 17 19 20 21 22 23 24...

result:

ok 

Test #30:

score: 0
Accepted
time: 9ms
memory: 4420kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
29 1 13
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 27 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
0 2 29 30
1 1 11
1 27 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 28
0 2 32 33
1 1 22
1 27 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 23 ...

result:

ok 

Test #31:

score: 0
Accepted
time: 25ms
memory: 5964kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 15 42
32 210
220 359
210 369
204 275
206 353
210 365
254 353
210 355
207 358
223 374
221 352
222 353
211 274
221 274
220 327
211 352
194 275
207 374
220 375
208 275
223 358
211 275
221 275
210 274
207 353
223 353
210 352
220 374
220 358
210 275
220 353
10 11
1...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
3086
1 8 15 64 99 182 239 248 301 382
1 441 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 65 66 67 68 69 70 71 72 73 74 75 76 7...

result:

ok 

Test #32:

score: 0
Accepted
time: 19ms
memory: 4908kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
15 30 2
94 170
33 3
111 73
28 29
312 282
134 224
107 104
93 82
217 222
19 125
436 437
230 231
199 196
298 299
61 50
233 238
362 363
176 146
452 453
491 501
225 195
16 17
241 246
180 181
410 484
450 300
162 163
181 138
446 408
493 482
116 117
164 129
441 447
148 2...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
3338
1 64 15 26 39 43 63 64 77 79 88 95 98 99 107 110 113 115 116 165 171 172 173 182 186 191 205 207 210 217 228 233 235 238 239 241 243 244 248 255 260 262 271 273 279 280 283 290 301 310 318 326 330 348 369 381 382 387 388 403 405 411 424 427 430 435
1 105 ...

result:

ok 

Test #33:

score: 0
Accepted
time: 21ms
memory: 4944kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 1
64 184
397 491
205 206
278 279
366 367
566 567
421 387
156 250
528 529
415 400
429 430
748 749
413 507
408 390
68 69
649 759
79 429
1012 1013
79 64
368 369
963 964
64 65
147 241
37 38
336 702
171 137
240 222
239 224
305 306
133 134
688 670
996 998
742 546...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1670
1 244 0 4 12 15 17 26 28 30 39 40 43 45 52 56 63 64 66 67 77 78 79 83 88 91 95 98 99 105 107 110 113 114 115 116 119 132 133 138 143 151 165 171 172 173 174 177 182 186 191 192 205 207 210 211 214 215 217 219 225 228 229 233 235 237 238 239 241 243 244 24...

result:

ok 

Test #34:

score: 0
Accepted
time: 20ms
memory: 5212kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 15
94 198
999 950
457 594
733 622
77 497
395 699
578 902
340 698
110 375
475 651
367 560
633 941
336 644
426 279
320 301
177 485
173 62
271 976
373 258
12 277
358 995
225 148
451 747
4 502
112 362
714 1018
544 1011
368 707
532 914
708 673
757 838
52 435
202...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1670
1 20 12 15 43 88 105 119 143 182 205 262 293 310 462 465 532 694 725 747 760 872
1 489 1 2 4 6 7 8 9 10 13 14 18 19 20 21 22 23 24 25 26 28 30 33 35 36 37 38 39 40 47 48 49 50 51 52 53 54 55 57 60 64 65 66 67 68 69 71 72 76 78 79 80 81 83 84 86 91 94 95 9...

result:

ok 

Test #35:

score: 0
Accepted
time: 23ms
memory: 5656kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 29
94 212
85 934
369 600
122 969
208 497
151 594
51 972
739 967
330 903
505 270
436 744
428 853
279 296
239 979
141 761
149 923
249 368
240 479
171 604
441 971
300 551
386 918
305 905
273 1001
298 540
705 964
251 661
536 985
272 930
16 583
651 1021
112 904
...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1670
1 11 43 107 191 215 243 248 273 639 659 715 737
1 671 0 2 3 4 5 6 7 8 9 10 11 13 14 15 16 18 20 25 26 28 31 32 33 34 35 36 37 38 39 40 42 44 45 46 47 49 51 52 56 57 59 60 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 78 80 81 82 83 87 88 90 91 92 93 94 95 ...

result:

ok 

Test #36:

score: 0
Accepted
time: 26ms
memory: 5840kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 44
94 227
59 866
167 925
78 1006
459 937
110 937
242 968
195 657
149 635
254 738
83 1011
81 660
90 897
186 633
50 567
185 990
250 728
196 925
195 694
209 563
186 571
144 529
213 528
252 724
144 909
425 897
250 635
225 695
484 939
149 914
190 931
173 900
19 ...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1664
1 7 107 173 279 369 411 523 672
1 889 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75...

result:

ok 

Test #37:

score: 0
Accepted
time: 26ms
memory: 5488kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
30 30 58
12 241
240 882
241 883
237 919
236 918
202 919
236 953
241 916
239 882
241 882
236 919
323 322
323 289

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1634
1 9 43 107 191 243 248 273 639 659 737
1 891 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 7...

result:

ok 

Subtask #4:

score: 0
Wrong Answer

Dependency #3:

100%
Accepted

Test #38:

score: 0
Wrong Answer
time: 90ms
memory: 11404kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
100 100 50
100 373
2576 5424
552 2444
1090 3586
698 7992
6043 6838
1364 8276
6025 8816
2900 5141
3114 3664
302 2171
3930 5433
2225 7225
6218 8326
1972 9191
1325 1432
5656 8200
5864 8290
4135 6498
3016 6790
8474 9563
6462 8785
2409 7590
6598 7251
1916 4460
276 447...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
152
1 49 98 182 205 228 233 403 559 725 923 977 1074 1120 1147 1375 2163 2199 2667 3342 3540 3692 3708 3998 4090 4135 4162 4302 4603 4741 4802 4842 4914 5279 5483 5506 5518 5605 6074 6246 7324 7465 7819 7823 8086 8650 8712 9454 9691 9707 9859
1 6186 1 2 3 5 6 ...

result:

wrong answer on inputs (29, 17), (51, 89), expected 0, but computed 1

Subtask #5:

score: 0
Wrong Answer

Test #48:

score: 12
Accepted
time: 17ms
memory: 5564kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 199 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
7541
1 50 0 4 12 15 17 26 28 30 39 40 43 45 52 56 63 64 66 67 77 78 79 83 88 91 95 98 99 105 107 110 113 114 115 116 119 132 133 138 143 151 165 171 172 173 174 177 182 186 191 192
1 84 2 6 7 8 9 10 19 20 21 22 23 24 32 33 34 35 36 37 47 48 49 50 54 58 59 60 6...

result:

ok 

Test #49:

score: 0
Accepted
time: 13ms
memory: 4660kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 199 99
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
2975
1 1 116
1 197 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84...

result:

ok 

Test #50:

score: 0
Accepted
time: 13ms
memory: 4728kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 199 100
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
3035
1 1 182
1 197 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84...

result:

ok 

Test #51:

score: -12
Wrong Answer
time: 9ms
memory: 4572kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 199 198
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1622
1 1 116
1 198 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83...

result:

wrong answer on inputs (0, 14), (0, 19), expected 0, but computed 1

Subtask #6:

score: 0
Wrong Answer

Test #70:

score: 8
Accepted
time: 4ms
memory: 4120kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 1
3 128
128 129
128 130
128 131

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 0
1 1 3
0 2 4 5
1 1 0
1 1 3
0 2 7 8
1 1 1
1 1 2
0 2 10 11
1 1 2
1 1 1
0 2 13 14
1 1 3
1 1 0
0 2 16 17
1 1 1
1 1 2
0 2 19 20
1 1 0
1 1 3
0 2 22 23
1 1 0
1 1 3
0 2 25 26
1 1 3
1 1 0
0 2 28 29
1 1 3
1 1 0
0 2 31 32
1 1 3
1 1 0
0 2 34 35
1 1 2
1 1 1
0 2 3...

result:

ok 

Test #71:

score: 0
Accepted
time: 4ms
memory: 4124kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 2
3 129
129 128
129 131
129 130

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
9992
1 1 3
1 2 1 2
0 2 4 5
1 1 2
1 2 0 3
0 2 7 8
1 1 3
1 2 1 2
0 2 10 11
1 1 3
1 2 1 2
0 2 13 14
1 1 3
1 2 1 2
0 2 16 17
1 1 0
1 2 1 2
0 2 19 20
1 1 0
1 2 1 2
0 2 22 23
1 1 3
1 2 1 2
0 2 25 26
1 1 3
1 2 1 2
0 2 28 29
1 1 2
1 2 0 3
0 2 31 32
1 1 0
1 2 1 2
0 2 3...

result:

ok 

Test #72:

score: 0
Accepted
time: 25ms
memory: 4480kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
101 29 1
8 254
254 255
254 227
254 252
254 196
254 224
254 2958
254 2986
254 226

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
515
1 737 0 4 12 15 17 26 28 30 39 40 43 45 52 56 63 64 66 67 77 78 79 83 88 91 95 98 99 105 107 110 113 114 115 116 119 132 133 138 143 151 165 171 172 173 174 177 182 186 191 192 205 207 210 211 214 215 217 219 225 228 229 233 235 237 238 239 241 243 244 248...

result:

ok 

Test #73:

score: -8
Wrong Answer
time: 26ms
memory: 6112kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
101 29 31
92 284
284 330
284 634
284 598
284 114
284 366
284 966
284 814
284 922
284 510
284 474
284 194
284 930
284 42
284 230
284 1002
284 438
284 526
284 778
284 186
284 6
284 958
284 150
284 562
284 886
284 78
284 402
284 850
284 482
284 222
284 367
284 671
2...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
515
1 26 4 40 43 448 753 791 878 928 1032 1280 1409 1440 1483 1680 1698 1712 1730 1919 1958 2072 2099 2355 2478 2517 2646 2762
1 1886 0 1 2 3 5 6 8 10 11 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 30 31 33 34 36 37 38 41 44 45 46 47 48 49 51 52 53 54 55 56 5...

result:

wrong answer on inputs (0, 0), (29, 1), expected 0, but computed 1

Subtask #7:

score: 0
Time Limit Exceeded

Test #101:

score: 0
Time Limit Exceeded

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
200 200 1
100 524
24804 34853
20956 34628
18830 29184
28919 32573
11364 24911
2226 5624
3715 30838
2206 17143
21162 27531
20198 27242
5007 12724
27160 32586
3535 7307
17015 25466
626 13891
9132 26194
9198 33073
815 7328
6938 21395
9489 30995
10804 21530
14698 394...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
41
1 9991 0 4 12 15 17 26 28 30 39 40 43 45 52 56 63 64 66 67 77 78 79 83 88 91 95 98 99 105 107 110 113 114 115 116 119 132 133 138 143 151 165 171 172 173 174 177 182 186 191 192 205 207 210 211 214 215 217 219 225 228 229 233 235 237 238 239 241 243 244 248...

result:


Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%