QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#324395 | #4832. Telepathy | hotboy2703 | 0 | 3ms | 4228kb | C++14 | 992b | 2024-02-10 18:14:02 | 2024-02-10 18:14:02 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll random(ll l,ll r){
return rng()%(r-l+1)+l;
}
ll myrandom(ll i){
return rng()%i;
}
ll a[] = {1,1,0,1,2,2,2,2,3,3,0,1,3,3,0,1};
int main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
string task;
cin>>task;
ll n,k;
cin>>n>>k;
string s;
cin>>s;
for (ll i = 1;i <= k;i ++){
ll mask = s[i*4-4]-'0'+(s[i*4-3]-'0')*2+(s[i*4-2]-'0')*4+(s[i*4-1]-'0')*8;
cout<<a[mask]+i*4-3<<' ';
}
cout<<'\n';
}
/*
Flim
20 5
00101011011110111001
4 8 11 16 17
0 1 1 1 1
Flam
20 5
11000111101000011010
1 7 12 15 20
0 1 1 1 1
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 4228kb
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...
output:
2 6 11 15 17 24 28 30 34 39 42 48 51 53 58 62 66 70 73 78 81 86 92 96 98 104 105 110 116 120 123 128 130 133 137 142 148 151 154 158 164 167 170 176 178 182 186 192 194 200 203 205 210 215 219 223 225 230 235 238 242 246 250 254 259 264 267 271 274 278 282 286 290 296 299 304 307 309 313 317 323 327...
input:
Flam 1000000 100000 0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...
output:
2 8 9 13 17 22 28 29 34 37 41 46 52 53 59 64 66 69 76 79 83 88 89 96 97 101 108 111 116 117 121 128 131 133 139 142 145 152 153 158 161 168 171 176 179 183 186 190 194 198 204 208 212 214 219 222 228 230 234 237 244 248 249 254 258 262 266 272 276 280 283 287 292 294 300 304 307 310 313 318 321 326 ...
result:
wrong answer 63228 matched, but you need to match at least 66666 positions