QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#101331#4913. 子集匹配lingchenCompile Error//C++14245b2023-04-29 10:24:092023-04-29 10:24:12

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-29 10:24:12]
  • 评测
  • [2023-04-29 10:24:09]
  • 提交

answer

#include "hall.h"
// #include "grader.cpp"
#include<cstdio>
using namespace std;

bitset<1<<15> b;

int solve(int n,int K,int s)
{
	for(int i=0; i<n; i++)
	if(((s>>i)&1)&&!b[s^(1<<i)])
	{
		b[s^(1<<i)]=1;
		return s^(1<<i);
	}
}

详细

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:6:1: error: ‘bitset’ does not name a type
    6 | bitset<1<<15> b;
      | ^~~~~~
answer.code: In function ‘int solve(int, int, int)’:
answer.code:11:25: error: ‘b’ was not declared in this scope
   11 |         if(((s>>i)&1)&&!b[s^(1<<i)])
      |                         ^
answer.code:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^