QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394294 | #4913. 子集匹配 | juruoA | Compile Error | / | / | C++14 | 232b | 2024-04-20 11:05:18 | 2024-04-20 11:05:18 |
Judging History
answer
#include "hall.h"
typedef long long li;
void solve(li n, li k, li s){
li p = -1, w = 0, pw = 0;
for(li i = 0; i < n; i++){
if((s >> i) & 1) w--;
else w++;
if(w >= pw) pw = w, 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: In function ‘void solve(li, li, li)’: answer.code:10:18: error: return-statement with a value, in function returning ‘void’ [-fpermissive] 10 | return s ^ (1 << (p + 1)); | ~~^~~~~~~~~~~~~~~~