QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#220903 | #147. Floppy | Ahmed57# | 0 | 668ms | 6032kb | C++20 | 1.1kb | 2023-10-20 22:54:01 | 2024-07-04 02:20:49 |
Judging History
floppy
#include <bits/stdc++.h>
using namespace std;
#include "floppy.h"
void read_array(int subtask_id,const std::vector<int> &v){
vector<pair<int,int>> xd;
for(int i = 0;i<v.size();i++)xd.push_back({v[i],i});
int e = log2(v.size());
sort(xd.begin(),xd.end());
reverse(xd.begin(),xd.end());
string b;
for(auto i : xd){
for(int d = e;d>=0;d--){
if(i.second&(1<<d))b+='1';
else b+='0';
}
}
save_to_floppy(b);
}
vector<int>solve_queries(int subtask_id,int N,const std::string &bits,const std::vector<int> &a,const std::vector<int> &b){
int x = log2(N);
int lol[N] = {0};
for(int i = 0;i<N;i++){
int id = 0;
for(int d = x;d>=0;d--){
if(bits[i*x+(x-d)]=='1')id&=(1<<d);
}
lol[id] = N-i-1;
}
vector<int> ans;
for(int i = 0;i<a.size();i++){
int ind = 0 , ma = -1;
for(int j = a[i];j<=b[i];j++){
if(ma<lol[j]){
ma = lol[j];
ind = j;
}
}
ans.push_back(ind);
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3876kb
input:
1 496 484 491 478 483 452 446 458 493 453 457 468 418 440 241 267 365 462 441 495 39 54 70 26 97 152 24 105 85 170 298 42 275 305 295 297 207 211 296 184 346 98 123 171 157 135 194 243 156 115 196 169 53 138 93 263 251 201 195 333 324 396 338 270 311 359 289 290 486 403 183 339 310 473 464 471 469 4...
output:
4464 0000100100011100110000001111001100010000000011001110001111010111001101000011001100010000111001101010000000000000000110011010101000111110110010010011010000000000100010111000010011000011001110011111010010010000011111110010010101001101110010010110000010101111011111001101101001001110010010011001010...
input:
1 496 4464 0000100100011100110000001111001100010000000011001110001111010111001101000011001100010000111001101010000000000000000110011010101000111110110010010011010000000000100010111000010011000011001110011111010010010000011111110010010101001101110010010110000010101111011111001101101001001110010010011...
output:
109 14 33 227 104 9 281 373 67 167 77 336 33 52 146 358 321 452 180 198 18 19 379 121 211 227 98 32 26 0 67 92 120 197 113 323 22 352 26 127 35 370 66 450 8 41 8 117 330 89 62 396 363 221 54 116 64 196 113 351 79 138 91 0 248 251 170 120 61 289 10 119 31 346 368 169 152 187 88 70 355 235 254 39 160 ...
result:
wrong answer wrong answer on query #1 (a = 109, b = 205): read 109 but expected 115
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 44ms
memory: 4500kb
input:
2 9998 941669562 945620824 923950848 951745929 487936934 545172907 544098433 249251812 620978276 575815248 584717207 588068187 353162497 679201670 592738155 438327774 762119945 576801563 408534366 592715009 525377786 603981493 -93758897 137509462 -38676966 -36724784 654920761 -595506762 -645387884 -...
output:
139972 01011111110011011100101010100101101000000010011011110110100100100001101001011001110110010101110011100101011110011001110000011101101000001000011000111110111001101111110110010101110110010111111010100110110000010001011110100000100001111011111001101111110001110010100111011010010111100110100111010...
input:
2 9998 139972 0101111111001101110010101010010110100000001001101111011010010010000110100101100111011001010111001110010101111001100111000001110110100000100001100011111011100110111111011001010111011001011111101010011011000001000101111010000010000111101111100110111111000111001010011101101001011110011010...
output:
2131 1837 185 2122 5976 5097 3223 11 3551 4558 457 5241 358 3248 3908 1065 819 467 1248 7240 2107 859 1148 5159 658 4976 120 3414 1085 6647 1939 7761 3974 2206 7033 7166 7415 1633 1981 1947 4196 7069 421 4239 1306 3950 1467 2407 6222 4897 1020 1672 4574 1598 7710 576 4183 5937 1594 3343 6146 8356 60...
result:
wrong answer wrong answer on query #1 (a = 2131, b = 6955): read 2131 but expected 6131
Subtask #3:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 668ms
memory: 6032kb
input:
3 39995 922975946 766568552 929754744 983095922 988967630 879723897 928174186 951250463 831467029 836738151 464712826 467214506 167661408 156498284 426000721 530835328 -35115993 -86200136 327603078 448684869 192895652 125768327 402822176 196767853 409109378 985776352 976681898 967347754 989156210 99...
output:
639920 10011010011000000100010111111111100100011101010100000010010010000000111000001101010000011001101001000100101001100000001000101010100101000111000010010010111011010000100010101001010000111010000001000100010111010100010010001111000000011011001010011011101100010110100111000100010010010100001000000...
input:
3 39995 639920 100110100110000001000101111111111001000111010101000000100100100000001110000011010100000110011010010001001010011000000010001010101001010001110000100100101110110100001000101010010100001110100000010001000101110101000100100011110000000110110010100110111011000101101001110001000100100101000...
output:
9100 2675 1691 13982 6610 6023 5767 14541 5584 17214 15083 2783 20373 5830 37440 32950 17569 7801 4066 15715 21204 13131 4452 5087 17215 11839 25357 16654 14328 33405 9909 11157 8236 16523 16436 15098 8443 6407 4790 4156 6720 15308 446 27661 1276 29360 27228 4076 1692 2867 39017 19267 15601 22532 27...
result:
wrong answer wrong answer on query #1 (a = 9100, b = 12589): read 9100 but expected 11215