QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#448354#8781. Element-Wise ComparisonmarherCompile Error//C++20390b2024-06-19 15:40:492024-06-19 15:40:50

Judging History

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

  • [2024-06-19 15:40:50]
  • 评测
  • [2024-06-19 15:40:49]
  • 提交

answer

#pragma GCC optimize("Ofast","inline")
#include<bits/stdc++.h>const int N=5e4+5;int A,n,p[N],m,i,x,j;std::bitset<N>S[N],b[N],M,f;main(){std::cin>>n>>m;for(i=1;i<=n;i++)std::cin>>x,p[x]=i,M[i]=S[0][i]=f[i]=1;for(i=1;i<=n;i++)M[p[i]]=0,b[p[i]]=(M>>p[i]);for(i=1;i<=n;i+=m){M=f;for(j=1;j<=m;j++)M&=b[i+j-1],A+=(M&S[m-j]).count();if(i+m<=n)for(j=1;j<=m;j++)S[j]=S[j-1]&b[i+m-j];}std::cout<<A;}

Details

answer.code:2:30: warning: extra tokens at end of #include directive
    2 | #include<bits/stdc++.h>const int N=5e4+5;int A,n,p[N],m,i,x,j;std::bitset<N>S[N],b[N],M,f;main(){std::cin>>n>>m;for(i=1;i<=n;i++)std::cin>>x,p[x]=i,M[i]=S[0][i]=f[i]=1;for(i=1;i<=n;i++)M[p[i]]=0,b[p[i]]=(M>>p[i]);for(i=1;i<=n;i+=m){M=f;for(j=1;j<=m;j++)M&=b[i+j-1],A+=(M&S[m-j]).count();if(i+m<=n)for(j=1;j<=m;j++)S[j]=S[j-1]&b[i+m-j];}std::cout<<A;}
      |                              ^~~
answer.code:2:9: fatal error: bits/stdc++.h>cons: No such file or directory
    2 | #include<bits/stdc++.h>const int N=5e4+5;int A,n,p[N],m,i,x,j;std::bitset<N>S[N],b[N],M,f;main(){std::cin>>n>>m;for(i=1;i<=n;i++)std::cin>>x,p[x]=i,M[i]=S[0][i]=f[i]=1;for(i=1;i<=n;i++)M[p[i]]=0,b[p[i]]=(M>>p[i]);for(i=1;i<=n;i+=m){M=f;for(j=1;j<=m;j++)M&=b[i+j-1],A+=(M&S[m-j]).count();if(i+m<=n)for(j=1;j<=m;j++)S[j]=S[j-1]&b[i+m-j];}std::cout<<A;}
      |         ^~~~~~~~~~~~~~~~~~~~
compilation terminated.