QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#469194#5033. Y 君的序列MEKHANE0 1ms5836kbC++14904b2024-07-09 15:51:452024-07-09 15:51:45

Judging History

你现在查看的是最新测评结果

  • [2024-07-09 15:51:45]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:5836kb
  • [2024-07-09 15:51:45]
  • 提交

answer

#include<bits/stdc++.h>
#include "seq.h"
#define rep(i,j,k) for(int i=j;i<=k;i++)
#define per(i,j,k) for(int i=j;i>=k;i--)
using namespace std;
const int N=1e5+5;
int a[N],wz[N],b[N],dy[N],xl1[N],xl2[N];
void cz(int x,int y){
    int mc=__lg(x+y),dx=x,dy=y,d1=wz[x],d2=wz[y]; swap(a[d1],a[d2]),swap(wz[x],wz[y]);
    while(1){if(dx==y) break; else if(dx%2==0) add(d1,d2),dy+=dx/2,dx/=2; else add(d2,d1),dx+=dy/2,dy/=2;}
}
void SEQ(int n,int M){
    rep(i,1,n) a[i]=i,wz[i]=i,b[i]=Get(i);
    answer(1),dy[2]=1;
    rep(i,3,n) dy[i]=dy[i-1]+((1<<dy[i-1])+1<=i); 
    per(i,n,2){
        int d1=a[i],d2=b[i],t1=0,t2=0;
        if(d1==d2) continue;
        while(d1!=1) xl1[++t1]=d1,d1=(1<<dy[d1])+1-d1;
        while(d2!=1) xl2[++t2]=d2,d2=(1<<dy[d2])+1-d2;
        xl1[++t1]=xl2[++t2]=1;
        rep(j,1,t1-1) cz(xl1[j],xl1[j+1]);
        per(j,t2-1,1) cz(xl2[j+1],xl2[j]);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 17
Accepted
time: 0ms
memory: 3852kb

input:

1 10000000
1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #2:

score: -17
Wrong Answer
time: 1ms
memory: 5836kb

input:

8 10000000
7 6 5 2 8 1 4 3

output:

Wrong construction

result:

wrong answer 1st words differ - expected: 'Correct', found: 'Wrong'

Subtask #2:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 0ms
memory: 3672kb

input:

121 1500000
121 1 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 91 92 93 94 95 96 97 98...

output:

Wrong construction

result:

wrong answer 1st words differ - expected: 'Correct', found: 'Wrong'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%