QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#400966#4913. 子集匹配11d10xyCompile Error//C++17266b2024-04-27 19:17:192024-04-27 19:17:20

Judging History

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

  • [2024-04-27 19:17:20]
  • 评测
  • [2024-04-27 19:17:19]
  • 提交

answer

#include<hall.h>
int solve(int n,int k,int s){
   int a[30],m=1;a[1]=0;
   for(int i=0;i<n;i++)if(s>>i&1&&m>1&&a[m]!=(s&(1<<i-1)-1)){
      m--;for(int k=1;k<=m;k++)a[k]|=1<<i;
   }else a[m+1]=a[m]|1<<i,m++;
   for(int i=1;i<=m;i++)if(a[i]==s)return a[i-1];
}

详细

implementer.cpp: In function ‘int main()’:
implementer.cpp:37:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   37 |         scanf("%d %d",&n,&K); assert(1<=n&&n<=27&&2*K>n);
      |         ~~~~~^~~~~~~~~~~~~~~
answer.code:1:9: fatal error: hall.h: No such file or directory
    1 | #include<hall.h>
      |         ^~~~~~~~
compilation terminated.