QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#324365#4832. Telepathyucup-team1069#0 4ms5028kbC++231.2kb2024-02-10 18:00:232024-02-10 18:00:23

Judging History

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

  • [2024-02-10 18:00:23]
  • 评测
  • 测评结果:0
  • 用时:4ms
  • 内存:5028kb
  • [2024-02-10 18:00:23]
  • 提交

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;
    for (int i = 0; i < n; i += 4) {
        int p = 0;
        for (int j = 0; j < 4; ++j) {
            if (t[i + j] == '0') {
                p = i + j + 1;
            }
        }
        if (p == 0) {
            p = i + 4;
        }
        ans.push_back(p);
        if (ans.size() == k) break;
    }
    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 << " ";

    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 4ms
memory: 5028kb

input:

Flim
1000000 100000
1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...

output:

3 8 12 16 17 22 27 32 36 40 44 46 52 53 60 64 67 72 76 80 84 88 91 94 100 103 105 112 114 118 124 127 132 136 139 144 146 152 156 160 162 168 172 174 179 184 188 191 196 199 204 207 211 216 220 224 228 232 236 240 243 248 252 256 260 263 268 272 275 280 284 288 291 294 300 302 308 311 315 320 324 32...

input:

Flam
1000000 100000
0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...

output:

4 6 12 16 20 24 27 29 36 39 44 47 51 55 60 63 67 72 74 80 84 87 89 94 100 101 107 112 115 117 123 126 132 135 140 144 145 150 156 160 164 167 172 174 180 184 188 192 196 200 202 207 210 215 220 224 226 231 236 239 242 246 251 256 260 263 268 271 275 279 284 288 290 295 299 302 308 312 313 320 323 32...

result:

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