QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394214#4913. 子集匹配cz_yxxCompile Error//C++20207b2024-04-20 10:21:392024-04-20 10:21:39

Judging History

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

  • [2024-04-20 10:21:39]
  • 评测
  • [2024-04-20 10:21:39]
  • 提交

answer

#include <hall.h>
int solve(int n, int k, int s){
    int p = 0, m = 0;
    for (int i = 0, w = 0; i < n; w >= m && (p = i + 1, m = w), ++i)
        (s >> i & 1) ? --w : ++w;
    return s ^ (1 << p);
}

Details

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.