QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#164237 | #4913. 子集匹配 | yyyyxh | 100 ✓ | 604ms | 20348kb | C++17 | 205b | 2023-09-04 20:50:59 | 2023-09-04 20:50:59 |
Judging History
answer
#include "hall.h"
int solve(int n,int k,int cur){
int cnt=0,pos=-1,mn=0x3f3f3f3f;
for(int i=0;i<n;++i){
if(mn>=cnt) mn=cnt,pos=i;
if(cur>>i&1) ++cnt;
else --cnt;
}
return cur^(1<<pos);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 5
Accepted
time: 1ms
memory: 3648kb
input:
14 8
output:
OK
result:
ok "OK"
Test #2:
score: 5
Accepted
time: 1ms
memory: 3740kb
input:
15 8
output:
OK
result:
ok "OK"
Test #3:
score: 5
Accepted
time: 1ms
memory: 3704kb
input:
15 9
output:
OK
result:
ok "OK"
Test #4:
score: 5
Accepted
time: 0ms
memory: 3680kb
input:
15 10
output:
OK
result:
ok "OK"
Test #5:
score: 5
Accepted
time: 0ms
memory: 4000kb
input:
18 10
output:
OK
result:
ok "OK"
Test #6:
score: 5
Accepted
time: 2ms
memory: 3812kb
input:
19 10
output:
OK
result:
ok "OK"
Test #7:
score: 5
Accepted
time: 2ms
memory: 3800kb
input:
19 11
output:
OK
result:
ok "OK"
Test #8:
score: 5
Accepted
time: 3ms
memory: 3680kb
input:
19 12
output:
OK
result:
ok "OK"
Test #9:
score: 5
Accepted
time: 26ms
memory: 4192kb
input:
22 12
output:
OK
result:
ok "OK"
Test #10:
score: 5
Accepted
time: 66ms
memory: 4684kb
input:
23 12
output:
OK
result:
ok "OK"
Test #11:
score: 5
Accepted
time: 49ms
memory: 4764kb
input:
23 13
output:
OK
result:
ok "OK"
Test #12:
score: 5
Accepted
time: 32ms
memory: 4708kb
input:
23 14
output:
OK
result:
ok "OK"
Test #13:
score: 5
Accepted
time: 118ms
memory: 5636kb
input:
24 13
output:
OK
result:
ok "OK"
Test #14:
score: 5
Accepted
time: 272ms
memory: 7828kb
input:
25 13
output:
OK
result:
ok "OK"
Test #15:
score: 5
Accepted
time: 223ms
memory: 8012kb
input:
25 14
output:
OK
result:
ok "OK"
Test #16:
score: 5
Accepted
time: 155ms
memory: 7832kb
input:
25 15
output:
OK
result:
ok "OK"
Test #17:
score: 5
Accepted
time: 516ms
memory: 11944kb
input:
26 14
output:
OK
result:
ok "OK"
Test #18:
score: 5
Accepted
time: 604ms
memory: 20132kb
input:
27 14
output:
OK
result:
ok "OK"
Test #19:
score: 5
Accepted
time: 580ms
memory: 20340kb
input:
27 15
output:
OK
result:
ok "OK"
Test #20:
score: 5
Accepted
time: 571ms
memory: 20348kb
input:
27 16
output:
OK
result:
ok "OK"