QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#139244#147. Floppybashkort0 36ms6364kbC++201.1kb2023-08-12 21:11:382023-08-12 21:11:39

Judging History

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

  • [2023-08-12 21:11:39]
  • 评测
  • 测评结果:0
  • 用时:36ms
  • 内存:6364kb
  • [2023-08-12 21:11:38]
  • 提交

floppy

#include <bits/stdc++.h>
#include "floppy.h"

using namespace std;

void read_array(int subtask_id, const std::vector<int> &v) {
    string s;
    vector<int> stk;
    for (int i = 0; i < size(v); ++i) {
        while (!stk.empty() && v[stk.back()] <= v[i]) {
            s += '0';
            stk.pop_back();
        }
        stk.push_back(i);
        s += '1';
    }
    save_to_floppy(s);
}

std::vector<int> solve_queries(int subtask_id, int N,
        const std::string &bits,
        const std::vector<int> &a, const std::vector<int> &b) {
    int L = size(bits), Q = size(a);

    vector<int> answers(Q), stk;
    vector<vector<int>> queries(N);

    for (int i = 0; i < Q; ++i) {
        queries[b[i]].push_back(i);
    }

    for (int i = 0, j = 0; i < N; ++i, ++j) {
        while (bits[j] == '0') {
            stk.pop_back();
            j += 1;
        }
        stk.push_back(i);
        for (int k : queries[i]) {
            answers[k] = *lower_bound(stk.begin(), stk.end(), k);
        }
    }

    return answers;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3732kb

input:

1 496
484
491
478
483
452
446
458
493
453
457
468
418
440
241
267
365
462
441
495
39
54
70
26
97
152
24
105
85
170
298
42
275
305
295
297
207
211
296
184
346
98
123
171
157
135
194
243
156
115
196
169
53
138
93
263
251
201
195
333
324
396
338
270
311
359
289
290
486
403
183
339
310
473
464
471
469
4...

output:

986
10110111001000110101101101010011000011010110010110110001011010011011010110000110101110001011100111011000001111000011000111010011010001110110001101100011011100010110110011101011000000111100010101100110000110110011011001100110100001111010011101100000110111011110000011110100001101101010011110010100...

input:

1 496
986
10110111001000110101101101010011000011010110010110110001011010011011010110000110101110001011100111011000001111000011000111010011010001110110001101100011011100010110110011101011000000111100010101100110000110110011011001100110100001111010011101100000110111011110000011110100001101101010011110...

output:

18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
115
115
115
115
115
115
115
115
39
67
115
115
115
115
115
115
115
115
115
67
115
115
115
115
115
115
67
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115
115...

result:

wrong answer wrong answer on query #1 (a = 109, b = 205): read 18 but expected 115

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 12ms
memory: 4240kb

input:

2 9998
941669562
945620824
923950848
951745929
487936934
545172907
544098433
249251812
620978276
575815248
584717207
588068187
353162497
679201670
592738155
438327774
762119945
576801563
408534366
592715009
525377786
603981493
-93758897
137509462
-38676966
-36724784
654920761
-595506762
-645387884
-...

output:

19989
101100110111000110101100011100011100110011011010001110010101010111000111100011001110110011100000110110000110101100111101110000000110110011001011010101110100110011011100010100110110011100110001110000000001101110100110101110010111001111001000011010011110010010011011101001010011000111010110001111...

input:

2 9998
19989
10110011011100011010110001110001110011001101101000111001010101011100011110001100111011001110000011011000011010110011110111000000011011001100101101010111010011001101110001010011011001110011000111000000000110111010011010111001011100111100100001101001111001001001101110100101001100011101011...

output:

6131
6131
359
6131
6131
6131
6131
359
6131
6131
359
6131
359
6131
6131
359
6131
359
6131
6131
359
6131
5760
5760
6131
6131
359
6131
6131
6131
6131
6131
6131
359
6131
6131
6131
6131
6131
359
6131
6131
6131
6131
6131
5760
6131
6131
6131
6131
6131
359
6131
359
6131
359
6131
6131
6131
6131
6131
6131
613...

result:

wrong answer wrong answer on query #11 (a = 457, b = 3181): read 359 but expected 2817

Subtask #3:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 36ms
memory: 6364kb

input:

3 39995
922975946
766568552
929754744
983095922
988967630
879723897
928174186
951250463
831467029
836738151
464712826
467214506
167661408
156498284
426000721
530835328
-35115993
-86200136
327603078
448684869
192895652
125768327
402822176
196767853
409109378
985776352
976681898
967347754
989156210
99...

output:

79980
110010101101011011011100100111001011100110010000011100001011010110010011111000011011000110111011000110110100100110000111101010100110100011011011001100111101010100000011011100111001001110010011010110100011010101011001101101000011101001101011110111000000001011010000011011011010011101001000110111...

input:

3 39995
79980
1100101011010110110111001001110010111001100100000111000010110101100100111110000110110001101110110001101101001001100001111010101001101000110110110011001111010101000000110111001110010011100100110101101000110101010110011011010000111010011010111101110000000010110100000110110110100111010010...

output:

584
584
17919
17919
584
584
584
17919
17919
17919
17919
17919
17919
584
17919
17919
17919
584
584
17919
17919
17919
17919
17919
584
584
17919
17919
17919
17919
17919
584
17919
17919
17919
17919
17919
17919
584
17919
17919
17919
584
17919
584
17919
17919
17919
584
17919
39520
17919
17919
17919
17919
...

result:

wrong answer wrong answer on query #1 (a = 9100, b = 12589): read 584 but expected 11215