QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#312729 | #4832. Telepathy | Unknown1508 | 0 | 18ms | 8216kb | C++20 | 805b | 2024-01-24 11:08:21 | 2024-01-24 11:08:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void main_program();
signed main(){
// ios_base::sync_with_stdio(0); cin.tie(0);
main_program();
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, k;
string player, s;
void main_program(){
cin >> player >> n >> k >> s;
if (player == "Flim"){
vector<int> lst(n);
iota(lst.begin(), lst.end(), 1);
shuffle(lst.begin(), lst.end(), rng);
for (int i = 0; i < k; i++){
cout << lst[i] << " \n"[i == k-1];
}
return;
}
int target = 0;
vector<int> lst;
for (int i = 0; i < n; i++){
if ((int)lst.size() == k) break;
if (s[i] - '0' == target){
lst.push_back(i + 1);
target ^= 1;
}
}
for (int i = 0; i < k; i++){
cout << lst[i] << " \n"[i == k-1];
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 18ms
memory: 8216kb
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...
output:
127049 201948 870168 655575 334431 236356 174659 727543 980789 345243 658728 210867 458919 838040 608712 321260 24444 439606 19433 604883 674000 906150 55491 403105 509152 268600 993107 539274 956273 90712 192827 180951 863223 44190 208451 73031 990861 103046 464154 564806 476326 107210 151723 67442...
input:
Flam 1000000 100000 0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...
output:
1 7 9 10 11 14 15 18 19 21 22 25 26 28 29 30 35 38 39 40 41 42 43 45 47 48 50 52 53 54 55 56 57 59 60 61 62 64 67 68 69 70 71 73 74 75 77 79 80 81 84 88 89 90 93 95 97 98 99 102 106 108 110 111 112 113 114 116 117 118 121 122 123 124 126 127 129 130 132 134 135 136 140 141 143 146 149 151 153 154 15...
result:
wrong answer