QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#324369#4832. Telepathyucup-team1069#0 7ms4908kbC++231.2kb2024-02-10 18:01:532024-02-10 18:01:55

Judging History

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

  • [2024-02-10 18:01:55]
  • 评测
  • 测评结果:0
  • 用时:7ms
  • 内存:4908kb
  • [2024-02-10 18:01:53]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n = 1e6, k = 1e5;
    string s, t;
    cin >> s >> n >> k >> t;
    vector<int> ans;
    int B = 10;
    for (int i = 0; i < n; i += B) {
        int p = 0;
        for (int j = 0; j < B; ++j) {
            if (t[i + j] == '0') {
                p = i + j + 1;
            }
        }
        if (p == 0) {
            p = i + B;
        }
        ans.push_back(p);
        if (ans.size() == k) break;
    }
    assert(ans.size() == k);
    for (int i : ans) cout << i << " ";
    cout << '\n';
    return 0;
    if (s == "Flim") {
        for (int i = 0; i < n; ++i) {
            if (t[i] == '0') {
                ans.push_back(i + 1);
                if (ans.size() == k) break;
            }
        }
        sort(ans.begin(), ans.end());
        for (int i : ans) cout << i << " ";
    }
    else {
        for (int i = n - 1; i >= 0; --i) {
            if (t[i] == '1') {
                ans.push_back(i + 1);
                if (ans.size() == k) break;
            }
        }
        sort(ans.begin(), ans.end());
        for (int i : ans) cout << i << " ";

    }
}

详细

Test #1:

score: 0
Wrong Answer
time: 7ms
memory: 4908kb

input:

Flim
1000000 100000
1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...

output:

3 17 27 40 46 53 67 80 90 100 110 118 130 139 146 160 168 179 190 199 207 220 230 236 243 260 270 280 288 300 309 320 330 339 348 360 369 379 390 400 405 420 429 440 449 459 470 479 488 499 510 520 529 538 550 556 567 579 590 599 609 619 628 638 649 659 668 678 690 700 710 720 727 740 748 756 770 77...

input:

Flam
1000000 100000
0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...

output:

9 20 29 39 50 60 69 80 89 100 110 117 129 140 150 160 170 180 190 200 210 220 226 239 249 256 270 279 290 299 308 320 330 340 345 357 370 380 390 399 409 420 430 440 450 460 468 479 489 499 510 519 528 540 550 560 569 579 590 600 609 618 630 640 649 660 670 676 690 697 707 716 729 740 750 760 768 77...

result:

wrong answer 66546 matched, but you need to match at least 66666 positions