QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394232 | #4913. 子集匹配 | hswfwkj | Compile Error | / | / | C++14 | 447b | 2024-04-20 10:28:35 | 2024-04-20 10:28:36 |
Judging History
answer
#include<bits/stdc++.h>
#include "hall.h"
using namespace std;
int solve(int n, int K, int s)
{
int mn = 0, pos = 0, num = 0;
for(int i = 1; i <= n; i++)
{
if(s & (1 << i - 1)) num++;
else num--;
if(num < mn) mn = num, pos = i;
}
return s ^ (1 << pos);
}
int main()
{
return 0;
// int n, k, s; int cnt = 3;
// cin >> n >> k;
// while(cnt--)
// {
// cin >> s;
// cout << solve(n, k, s) << '\n';
// }
}
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); | ~~~~~^~~~~~~~~~~~~~~ /usr/bin/ld: /tmp/cci9mqzW.o: in function `main': answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvlvMEY.o:implementer.cpp:(.text.startup+0x0): first defined here collect2: error: ld returned 1 exit status