QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#460630 | #4832. Telepathy | pavement | 0 | 18ms | 3684kb | C++14 | 1013b | 2024-07-01 22:52:44 | 2024-07-01 22:52:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int n, k;
char c;
string s;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> s >> n >> k;
for (int i = 1, cur = 0; i <= k; i++) {
int pos = -1;
string cs = "";
for (int j = 1; j <= n / k; j++) {
cin >> c;
cs.pb(c);
}
for (int j = 0; j < 2; j++) {
// cs[j*3:j*3+3]
string ccs = cs.substr(j * 3, 3);
if (ccs[0] == ccs[1] && ccs[1] == ccs[2]) {
continue;
}
int cnt_1 = (ccs[0] == '1') + (ccs[1] == '1') + (ccs[2] == '1');
if (cnt_1 == 1) {
for (int i = 0; i < 3; i++) {
if (ccs[i] == '1') {
pos = j * 3 + i;
}
}
} else {
int offset = (s == "Flim" ? -1 : 1);
for (int i = 0; i < 3; i++) {
if (ccs[i] == '0') {
pos = j * 3 + (i + offset + 3) % 3;
}
}
}
}
if (pos == -1) {
pos = n / k - 1;
} else {
pos += cur;
}
cur += n / k;
cout << pos + 1 << ' ';
}
cout << '\n';
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 18ms
memory: 3684kb
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...
output:
2 15 25 33 41 51 10 74 85 96 104 116 125 134 145 151 164 176 186 192 206 215 226 235 242 254 264 274 286 296 305 314 323 334 344 353 363 371 384 396 406 416 10 434 445 455 463 474 486 494 10 512 526 534 544 553 563 575 586 592 604 614 625 636 645 656 666 675 684 696 704 716 723 736 10 754 766 776 78...
input:
Flam 1000000 100000 0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...
output:
10 14 25 34 45 56 61 75 10 95 104 116 124 136 146 154 162 175 185 194 204 216 225 234 244 252 261 276 283 296 304 311 322 334 346 354 365 10 385 395 405 411 426 436 445 456 464 475 484 495 504 514 524 10 546 554 565 576 585 592 10 615 624 10 645 654 10 675 685 696 704 714 725 733 744 756 762 774 10 ...
result:
wrong answer