QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394586#4913. 子集匹配le0nCompile Error//C++14230b2024-04-20 16:29:042024-04-20 16:29:05

Judging History

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

  • [2024-04-20 16:29:05]
  • 评测
  • [2024-04-20 16:29:04]
  • 提交

answer

#include <hall.h>

int solve(int n, int K, int s)
{
	int i, t = 0, mn = 0, p = -1;
	for(i = 0; i < n; i++)
	{
		t += 2 * ((s >> i) & 1) - 1;
		if(t < mn)
		{
			mn = t;
			p = i;
		}
	}
	return s ^ (1 << (p + 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:10: fatal error: hall.h: No such file or directory
    1 | #include <hall.h>
      |          ^~~~~~~~
compilation terminated.