QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#469193#5033. Y 君的序列MEKHANECompile Error//C++14874b2024-07-09 15:50:312024-07-09 15:50:32

Judging History

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

  • [2024-07-09 15:50:32]
  • 评测
  • [2024-07-09 15:50:31]
  • 提交

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); else add(d2,d1);}
}
void SEG(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]);
    }
}

詳細信息

implementer.cpp: In function ‘void {anonymous}::StAr_WaRs::main()’:
implementer.cpp:46:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |                 scanf("%d %d",&n,&M);
      |                 ~~~~~^~~~~~~~~~~~~~~
implementer.cpp:47:45: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   47 |                 for (int i=1;i<=n;i++) scanf("%d",&b[i]),a[i]=i;
      |                                        ~~~~~^~~~~~~~~~~~
/usr/bin/ld: /tmp/ccZFqd0G.o: in function `main':
implementer.cpp:(.text.startup+0x77): undefined reference to `SEQ(int, int)'
collect2: error: ld returned 1 exit status