QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#277618#1780. Intact IntervalswangqingxianCompile Error//C++14994b2023-12-06 20:50:192023-12-06 20:50:20

Judging History

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

  • [2023-12-06 20:50:20]
  • 评测
  • [2023-12-06 20:50:19]
  • 提交

answer

#include<bits\stdc++.h>
#define For(i,l,r) for(int i=(l);i<=(r);++i)
#define rof(i,r,l) for(int i=(r);i>=(l);--i)
#define ull unsigned long long
#define int long long
using namespace std;
const int N=1e6+10,inf=2147483647,mod=1e9+7;
int n,a[N],b[N],c[N],m,ans=0;
ull h1[N],h2[N],fang[N],base=1145141;
signed main(){
    cin>>n;
    For(i,1,n){cin>>a[i];c[++m]=a[i];}
    For(i,1,n){cin>>b[i];c[++m]=b[i];}
    sort(c+1,c+1+m);
    m=unique(c+1,c+1+m)-c-1;
    fang[0]=1;
    For(i,1,m)fang[i]=fang[i-1]*base;
    For(i,1,n){
        h1[i]=h1[i-1]+fang[lower_bound(c+1,c+1+m,a[i])-c];
        h2[i]=h2[i-1]+fang[lower_bound(c+1,c+1+m,b[i])-c];
    }
    For(i,1,n)h1[i]-=h2[i];
    sort(h1+1,h1+1+n);
    int j=0;
    For(i,1,n){
        j++;
        if(h1[i]!=h1[i+1]||i==n){
            int res=1,k=2;
            while(j){if(j&1)res=res*k%mod;k=k*k%mod;j>>=1;}
            ans=(ans+res-1)%mod;
        }
    }
    cout<<(ans-n+mod)%mod<<endl;
    return 0;
}

詳細信息

answer.code:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.