QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#460163 | #4252. Permutation | Dimash | 0 | 1ms | 4116kb | C++20 | 548b | 2024-07-01 03:50:13 | 2024-07-01 03:50:13 |
answer
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> ret,g;
int hsb(ll x){
for(int i = 60;i >= 0;i--){
if((x >> i) & 1) return i;
}
}
vector<int> construct_permutation(long long k)
{
ret.clear();
g.clear();
int f = hsb(k);
for(int i = 0;i < f;i++){
g.push_back(i);
}
for(int i = f - 1;i >= 0;i--){
if((k >> i) & 1){
for(int j = i;j < (int)g.size();j++){
g[j]++;
}
ret.push_back(g[i] - 1);
}
}
for(int j:ret){
g.push_back(j);
}
return g;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4116kb
input:
a92b3f80-b312-8377-273c-3916024d7f2a 89 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
output:
6cad0f33-b1bd-3a3e-1a8d-c4af23adfcbf OK 1 0 2 1 0 2 0 1 3 1 2 0 3 0 2 1 4 1 3 1 0 3 0 1 2 4 1 2 3 0 4 0 2 3 1 5 1 3 4 1 0 4 0 1 3 2 5 1 2 4 2 0 5 0 2 4 2 1 6 1 3 5 2 1 0 4 0 1 2 3 5 1 2 3 4 0 5 0 2 3 4 1 6 1 3 4 5 1 0 5 0 1 3 4 2 6 1 2 4 5 2 0 6 0 2 4 5 2 1 7 1 3 5 6 2 1 0 5 0 1 2 4 3 6 1 2 3 5 3 0 ...
result:
wrong answer
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 1ms
memory: 3836kb
input:
a92b3f80-b312-8377-273c-3916024d7f2a 100 39993 85709 48645 25391 15360 54084 28947 18808 86735 316 14357 82845 96210 16242 58466 43439 77462 70742 76176 20397 30314 22634 29622 81835 31904 81283 37072 36527 26764 55878 72762 5262 34915 63468 20595 66579 77373 36670 89340 83384 73268 31960 67318 3908...
output:
6cad0f33-b1bd-3a3e-1a8d-c4af23adfcbf OK 22 1 2 3 5 7 9 10 11 12 13 15 17 19 20 21 12 11 10 5 4 3 0 25 1 2 4 6 7 8 10 12 13 15 17 19 20 21 23 24 14 11 10 9 7 6 3 2 0 22 1 2 4 5 6 7 8 9 10 12 14 16 18 20 21 13 12 11 10 9 2 0 22 1 3 5 7 8 10 11 12 14 16 17 18 19 21 13 9 8 5 3 2 1 0 16 0 1 2 3 4 5 6 7 8...
result:
wrong answer