QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#165189 | #4923. 整数 | Star32 | 0 | 3ms | 4116kb | C++14 | 674b | 2023-09-05 16:31:05 | 2023-09-05 16:31:06 |
answer
#include <bits/stdc++.h>
#include "integer.h"
using namespace std;
std::vector<int> findPermutation(int n){
vector<int> ret,res;
for(int i=0;i<n;i++)ret.push_back(-1),operate(i),res.push_back(i);
mt19937 rnd(time(0));
shuffle(res.begin(),res.end(),rnd);
int tim=0,pre=0;
while(!res.empty()){
vector<int> ser;
int dt=n,t=tim;
while(t&1)t>>=1,dt++;
for(int v:res){
int p=operate(v);
if(p>pre)ser.push_back(v);
else ret[v]=n+dt+p-pre-1,dt+=p-pre-1;
pre=p;
}
for(int i=0;i<n;i++){
if(ret[i]>-1&&ret[i]<n)pre=operate(i);
if(ret[i]>=n)ret[i]-=n;
if(ret[i]==0)pre=operate(i);
}
res=ser,tim++;
}
return ret;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 0ms
memory: 4116kb
input:
1 0
output:
68F82AC1898AF4BFACDCBB49543233A61773093A OK Passed using 6 operation(s): scoring 1.000 1.0000000000
result:
ok Passed using 6 operation(s): scoring 1.000
Test #2:
score: 0
Wrong Answer
time: 1ms
memory: 4116kb
input:
3 0 2 1
output:
68F82AC1898AF4BFACDCBB49543233A61773093A WA Incorrect answer: p_0 is expected to be 0 but found 2
result:
wrong answer Incorrect answer: p_0 is expected to be 0 but found 2
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #84:
score: 0
Wrong Answer
time: 3ms
memory: 4112kb
input:
5000 0 4022 1149 1576 2995 1809 3803 4188 1400 1251 4042 2830 766 4811 1622 4002 4474 1003 1152 130 4794 1902 1292 968 4673 3459 1795 3812 531 2335 1660 4968 3632 4047 353 4448 2515 1581 4259 1389 3628 3760 1381 2527 2353 4323 2807 386 1731 1973 1209 1982 232 747 2904 897 4375 2921 3384 457 1050 936...
output:
68F82AC1898AF4BFACDCBB49543233A61773093A WA Incorrect answer: p_0 is expected to be 0 but found 1976
result:
wrong answer Incorrect answer: p_0 is expected to be 0 but found 1976
Subtask #5:
score: 0
Skipped
Dependency #3:
0%