QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#324373#4832. Telepathyucup-team1069#0 8ms5044kbC++231.2kb2024-02-10 18:03:472024-02-10 18:03:47

Judging History

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

  • [2024-02-10 18:03:47]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:5044kb
  • [2024-02-10 18:03:47]
  • 提交

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 = 4;
    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;
                break;
            }
        }
        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: 100
Accepted
time: 8ms
memory: 4932kb

input:

Flim
1000000 100000
1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...

output:

3 8 12 13 17 22 26 31 36 37 42 45 52 53 60 64 67 72 73 77 81 86 89 94 98 101 105 109 113 117 124 126 129 133 137 143 146 152 154 158 162 165 171 173 179 183 187 190 193 198 201 205 211 213 217 222 225 230 233 240 243 248 251 255 258 261 265 269 275 278 281 287 291 294 298 301 306 309 313 317 321 325...

input:

Flam
1000000 100000
0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...

output:

1 5 9 13 17 22 26 29 35 37 41 47 50 53 57 62 67 69 74 77 84 85 89 93 97 101 106 110 114 117 121 126 129 133 140 143 145 149 153 159 161 165 169 174 178 182 188 190 195 199 201 205 209 215 217 221 226 231 235 237 242 246 249 253 260 263 268 270 273 277 281 285 289 295 298 301 306 312 313 319 321 327 ...

result:

ok 66746 matched

Test #2:

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

input:

Flim
1000000 100000
0100111111111101010011101010110100100101000101101111011100000000001000100010110011011010010000010011011100110000010001001111110101111000111011001110000101100000011110110100100100110101011101011001111001111011111100110010000110000101001111100011111100001001000000111110011001010100...

output:

1 8 12 15 17 24 26 31 33 37 41 45 52 53 57 61 65 69 73 79 83 86 89 93 97 101 105 109 113 117 124 127 129 134 140 143 148 149 153 157 161 166 169 174 177 181 185 189 194 200 201 206 212 213 217 221 226 229 233 240 241 248 249 254 257 261 268 269 273 277 281 285 289 293 300 302 305 311 313 320 323 325...

input:

Flam
1000000 100000
1011011100010010001100011101110001001000011011100101011000000110000111001100010011101101111010100011101011100110111111100011101000111101110001111110111000010110011100011101001111101100001111010000100110111001101110101000110110101101111010101111010010010011111010001001000110100001...

output:

2 5 9 13 17 21 27 31 33 38 41 48 49 53 57 61 65 71 75 77 84 87 92 94 97 102 108 109 116 120 121 126 129 135 139 141 148 152 153 157 161 165 171 173 180 183 185 191 193 198 202 206 210 214 218 223 226 231 236 238 244 245 250 253 260 262 266 269 274 277 281 287 289 294 298 303 306 309 314 317 321 326 ...

result:

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