QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#324371 | #4832. Telepathy | ucup-team1069# | 0 | 11ms | 4940kb | C++23 | 1.2kb | 2024-02-10 18:02:41 | 2024-02-10 18:02:42 |
Judging History
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 = 3;
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: 11ms
memory: 4940kb
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...
output:
3 6 9 12 14 17 21 22 27 30 32 36 37 42 45 46 51 53 57 60 63 66 67 72 75 78 81 84 87 90 91 94 99 102 105 108 111 114 117 118 123 126 129 132 135 137 139 144 146 150 152 156 159 162 165 168 171 174 177 179 183 184 188 191 195 198 201 204 207 210 213 216 217 222 225 228 231 234 236 240 243 246 249 252 ...
input:
Flam 1000000 100000 0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...
output:
3 6 9 12 15 17 20 24 27 29 33 36 39 41 44 47 51 53 57 60 63 66 69 72 74 78 80 84 87 89 93 94 99 101 105 107 110 114 117 120 123 126 129 132 135 138 140 144 145 150 153 156 159 161 165 167 170 174 177 180 182 184 189 192 195 196 201 202 207 210 213 215 218 222 224 226 231 234 237 239 242 246 249 251 ...
result:
wrong answer 65593 matched, but you need to match at least 66666 positions