QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#139502#2674. Vision programQwerty1232#14 21ms6344kbC++201.8kb2023-08-13 18:45:092024-07-04 01:41:17

Judging History

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

  • [2024-07-04 01:41:17]
  • 评测
  • 测评结果:14
  • 用时:21ms
  • 内存:6344kb
  • [2023-08-13 18:45:09]
  • 提交

answer

// #pragma GCC optimize("O3")
// #pragma GCC target("avx2")
#include "vision.h"

#include <bits/stdc++.h>

void construct_network(int n, int m, int k) {
    auto get = [&](int i, int j) {
        return i * m + j;
    };
    if (n * m == 2) {
        add_or({0, 1});
        return;
    }
    assert(n * m >= 2);
    int zero = add_and({0, 1, 2});
    int one = add_not(zero);

    std::vector<std::vector<int>> d1(n + m - 1), d2(n + m - 1);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            d1[i + j].push_back(get(i, j));
            d2[i - j + m - 1].push_back(get(i, j));
        }
    }

    auto make_cum = [&](std::vector<std::vector<int>> input) -> std::pair<int, int> {
        int n = input.size();
        std::vector<int> vec(n);
        for (int i = 0; i < n; i++) {
            vec[i] = add_or(input[i]);
        }
        std::vector<int> va;
        for (int i = 0; i + k < n; i++) {
            va.push_back(add_and({vec[i], vec[i + k]}));
        }
        int a = add_or(va);

        std::vector<int> fuck;
        for (int i = 0; i < n; i++) {
            std::vector<int> vc;
            for (int j = 0; j < n; j++) {
                if (abs(i - j) > k) {
                    vc.push_back(vec[j]);
                }
            }
            if (vc.size())
                fuck.push_back(add_and({add_or(vc), vec[i]}));
        }

        int not_fuck = zero;
        if (!fuck.empty()) {
            int fck = add_or(fuck);
            not_fuck = add_not(fck);
        }
        return {a, not_fuck};
    };

    auto [a1, b1] = make_cum(d1);
    auto [a2, b2] = make_cum(d2);

    // add_and({a1, a2});
    int p1 = add_and({a1, b2});
    int p2 = add_and({a2, b1});

    add_or({p1, p2});
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

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

output:

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

result:

ok 

Test #2:

score: -10
Wrong Answer
time: 0ms
memory: 3780kb

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
15
0 3 0 1 2
3 3
1 1 0
1 1 1
1 1 2
0 2 5 7
1 1 8
1 1 2
1 1 1
1 1 0
0 2 10 12
1 1 13
0 2 9 3
0 2 14 3
1 2 15 16

result:

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

Subtask #2:

score: 0
Wrong Answer

Test #19:

score: 11
Accepted
time: 0ms
memory: 3780kb

input:

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

output:

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

result:

ok 

Test #20:

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

input:

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

output:

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

result:

ok 

Test #21:

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

input:

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

output:

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

result:

ok 

Test #22:

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

input:

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

output:

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

result:

ok 

Test #23:

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

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
161
0 3 0 1 2
3 100
1 1 0
1 2 1 10
1 3 2 11 20
1 4 3 12 21 30
1 5 4 13 22 31 40
1 6 5 14 23 32 41 50
1 7 6 15 24 33 42 51 60
1 8 7 16 25 34 43 52 61 70
1 9 8 17 26 35 44 53 62 71 80
1 10 9 18 27 36 45 54 63 72 81 90
1 9 19 28 37 46 55 64 73 82 91
1 8 29 38 47 ...

result:

ok 

Test #24:

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

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
153
0 3 0 1 2
3 100
1 1 0
1 2 1 10
1 3 2 11 20
1 4 3 12 21 30
1 5 4 13 22 31 40
1 6 5 14 23 32 41 50
1 7 6 15 24 33 42 51 60
1 8 7 16 25 34 43 52 61 70
1 9 8 17 26 35 44 53 62 71 80
1 10 9 18 27 36 45 54 63 72 81 90
1 9 19 28 37 46 55 64 73 82 91
1 8 29 38 47 ...

result:

ok 

Test #25:

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

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
141
0 3 0 1 2
3 100
1 1 0
1 2 1 10
1 3 2 11 20
1 4 3 12 21 30
1 5 4 13 22 31 40
1 6 5 14 23 32 41 50
1 7 6 15 24 33 42 51 60
1 8 7 16 25 34 43 52 61 70
1 9 8 17 26 35 44 53 62 71 80
1 10 9 18 27 36 45 54 63 72 81 90
1 9 19 28 37 46 55 64 73 82 91
1 8 29 38 47 ...

result:

ok 

Test #26:

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

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
91
0 3 0 1 2
3 100
1 1 0
1 2 1 10
1 3 2 11 20
1 4 3 12 21 30
1 5 4 13 22 31 40
1 6 5 14 23 32 41 50
1 7 6 15 24 33 42 51 60
1 8 7 16 25 34 43 52 61 70
1 9 8 17 26 35 44 53 62 71 80
1 10 9 18 27 36 45 54 63 72 81 90
1 9 19 28 37 46 55 64 73 82 91
1 8 29 38 47 5...

result:

ok 

Test #27:

score: -11
Wrong Answer
time: 0ms
memory: 3784kb

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
47
0 3 0 1 2
3 100
1 1 0
1 2 1 10
1 3 2 11 20
1 4 3 12 21 30
1 5 4 13 22 31 40
1 6 5 14 23 32 41 50
1 7 6 15 24 33 42 51 60
1 8 7 16 25 34 43 52 61 70
1 9 8 17 26 35 44 53 62 71 80
1 10 9 18 27 36 45 54 63 72 81 90
1 9 19 28 37 46 55 64 73 82 91
1 8 29 38 47 5...

result:

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

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Wrong Answer

Test #48:

score: 12
Accepted
time: 4ms
memory: 4244kb

input:

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

output:

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

result:

ok 

Test #49:

score: 0
Accepted
time: 2ms
memory: 4256kb

input:

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

output:

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

result:

ok 

Test #50:

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

input:

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

output:

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

result:

ok 

Test #51:

score: -12
Wrong Answer
time: 0ms
memory: 3920kb

input:

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

output:

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

result:

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

Subtask #6:

score: 0
Wrong Answer

Test #70:

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

input:

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

output:

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

result:

ok 

Test #71:

score: -8
Wrong Answer
time: 0ms
memory: 3780kb

input:

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

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
15
0 3 0 1 2
3 4
1 1 0
1 2 1 2
1 1 3
0 2 6 8
1 1 9
1 1 1
1 2 0 3
1 1 2
0 2 11 13
1 1 14
0 2 10 4
0 2 15 4
1 2 16 17

result:

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

Subtask #7:

score: 14
Accepted

Test #101:

score: 14
Accepted
time: 21ms
memory: 6092kb

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
3201
0 3 0 1 2
3 40000
1 1 0
1 2 1 200
1 3 2 201 400
1 4 3 202 401 600
1 5 4 203 402 601 800
1 6 5 204 403 602 801 1000
1 7 6 205 404 603 802 1001 1200
1 8 7 206 405 604 803 1002 1201 1400
1 9 8 207 406 605 804 1003 1202 1401 1600
1 10 9 208 407 606 805 1004 1...

result:

ok 

Test #102:

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

input:

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

output:

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

result:

ok 

Test #103:

score: 0
Accepted
time: 2ms
memory: 4064kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
101 29 1
64 254
2572 2573
1820 1821
2037 2006
1976 1949
3033 3030
2991 2960
513 994
1467 1436
289 286
1774 1747
266 267
269 750
1996 1969
396 369
668 641
848 821
105 74
2239 2236
503 472
3010 3011
265 262
1921 1918
926 927
2092 2065
537 1018
2751 2720
2537 2534
1...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1041
0 3 0 1 2
3 2929
1 1 0
1 2 1 29
1 3 2 30 58
1 4 3 31 59 87
1 5 4 32 60 88 116
1 6 5 33 61 89 117 145
1 7 6 34 62 90 118 146 174
1 8 7 35 63 91 119 147 175 203
1 9 8 36 64 92 120 148 176 204 232
1 10 9 37 65 93 121 149 177 205 233 261
1 11 10 38 66 94 122 ...

result:

ok 

Test #104:

score: 0
Accepted
time: 2ms
memory: 4200kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
44 135 1
64 303
3956 3955
2873 2994
4171 4292
1161 1794
3633 3722
5975 5974
4529 4528
4900 5053
3455 3576
164 163
6091 6090
2758 2757
2716 2715
4129 4128
2352 2319
4355 4508
4666 4665
294 447
4882 5099
2882 2881
1356 1477
5098 4707
1180 1813
3029 3028
1465 1464
4...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
1433
0 3 0 1 2
3 5940
1 1 0
1 2 1 135
1 3 2 136 270
1 4 3 137 271 405
1 5 4 138 272 406 540
1 6 5 139 273 407 541 675
1 7 6 140 274 408 542 676 810
1 8 7 141 275 409 543 677 811 945
1 9 8 142 276 410 544 678 812 946 1080
1 10 9 143 277 411 545 679 813 947 1081...

result:

ok 

Test #105:

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

input:

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

output:

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

result:

ok 

Test #106:

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

input:

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

output:

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

result:

ok 

Test #107:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
200 100 1
64 424
2307 2215
15256 15257
9795 10727
11018 11019
12186 12094
10597 10393
17418 18350
4816 4724
11245 11246
15542 15402
9463 9416
7112 7020
10385 10386
4870 4794
635 636
19749 19750
12766 12658
14657 14658
8155 8063
10491 10271
5560 5596
10188 10080
1...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
2401
0 3 0 1 2
3 20000
1 1 0
1 2 1 100
1 3 2 101 200
1 4 3 102 201 300
1 5 4 103 202 301 400
1 6 5 104 203 302 401 500
1 7 6 105 204 303 402 501 600
1 8 7 106 205 304 403 502 601 700
1 9 8 107 206 305 404 503 602 701 800
1 10 9 108 207 306 405 504 603 702 801 ...

result:

ok 

Test #108:

score: 0
Accepted
time: 11ms
memory: 5320kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
100 200 1
64 424
2490 2418
12659 12660
16591 17287
15701 15469
2849 2809
10684 10685
9480 9481
13053 13749
677 678
18111 18039
8956 9652
3900 3828
14377 14378
11098 11099
6860 6861
11973 12701
12617 12618
9064 9065
1847 1800
6224 6225
6537 6538
17559 17640
13843 ...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
2401
0 3 0 1 2
3 20000
1 1 0
1 2 1 200
1 3 2 201 400
1 4 3 202 401 600
1 5 4 203 402 601 800
1 6 5 204 403 602 801 1000
1 7 6 205 404 603 802 1001 1200
1 8 7 206 405 604 803 1002 1201 1400
1 9 8 207 406 605 804 1003 1202 1401 1600
1 10 9 208 407 606 805 1004 1...

result:

ok 

Test #109:

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

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
200 200 1
64 524
29787 29780
29798 30014
5970 5162
1369 1370
33920 33921
21146 21330
27015 27008
24216 24217
10595 11835
38759 38752
21185 21186
22973 24181
2666 2850
14275 14300
5796 6012
21309 21310
34071 34287
19439 19432
17864 19072
28242 28243
4521 5729
1337...

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
3201
0 3 0 1 2
3 40000
1 1 0
1 2 1 200
1 3 2 201 400
1 4 3 202 401 600
1 5 4 203 402 601 800
1 6 5 204 403 602 801 1000
1 7 6 205 404 603 802 1001 1200
1 8 7 206 405 604 803 1002 1201 1400
1 9 8 207 406 605 804 1003 1202 1401 1600
1 10 9 208 407 606 805 1004 1...

result:

ok 

Subtask #8:

score: 0
Skipped

Dependency #1:

0%