QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394383 | #4913. 子集匹配 | Jelly_prx | 100 ✓ | 717ms | 20200kb | C++17 | 242b | 2024-04-20 14:06:57 | 2024-04-20 14:06:59 |
Judging History
answer
#include "hall.h"
#include<iostream>
#include<cstdio>
using namespace std;
int solve(int n,int k,int s){
int mn=0,pos=0,tot=0;
for(int i=1;i<=n;i++){
if(s&(1<<i-1)) tot++;
else tot--;
if(tot<=mn) mn=tot,pos=i;
}
return s^(1<<pos);
}
詳細信息
Test #1:
score: 5
Accepted
time: 1ms
memory: 3692kb
input:
14 8
output:
OK
result:
ok "OK"
Test #2:
score: 5
Accepted
time: 1ms
memory: 3760kb
input:
15 8
output:
OK
result:
ok "OK"
Test #3:
score: 5
Accepted
time: 1ms
memory: 3748kb
input:
15 9
output:
OK
result:
ok "OK"
Test #4:
score: 5
Accepted
time: 0ms
memory: 3632kb
input:
15 10
output:
OK
result:
ok "OK"
Test #5:
score: 5
Accepted
time: 2ms
memory: 4016kb
input:
18 10
output:
OK
result:
ok "OK"
Test #6:
score: 5
Accepted
time: 5ms
memory: 3692kb
input:
19 10
output:
OK
result:
ok "OK"
Test #7:
score: 5
Accepted
time: 3ms
memory: 3776kb
input:
19 11
output:
OK
result:
ok "OK"
Test #8:
score: 5
Accepted
time: 2ms
memory: 3692kb
input:
19 12
output:
OK
result:
ok "OK"
Test #9:
score: 5
Accepted
time: 30ms
memory: 4200kb
input:
22 12
output:
OK
result:
ok "OK"
Test #10:
score: 5
Accepted
time: 64ms
memory: 4792kb
input:
23 12
output:
OK
result:
ok "OK"
Test #11:
score: 5
Accepted
time: 51ms
memory: 4692kb
input:
23 13
output:
OK
result:
ok "OK"
Test #12:
score: 5
Accepted
time: 36ms
memory: 4788kb
input:
23 14
output:
OK
result:
ok "OK"
Test #13:
score: 5
Accepted
time: 118ms
memory: 6004kb
input:
24 13
output:
OK
result:
ok "OK"
Test #14:
score: 5
Accepted
time: 258ms
memory: 7916kb
input:
25 13
output:
OK
result:
ok "OK"
Test #15:
score: 5
Accepted
time: 227ms
memory: 8080kb
input:
25 14
output:
OK
result:
ok "OK"
Test #16:
score: 5
Accepted
time: 145ms
memory: 7764kb
input:
25 15
output:
OK
result:
ok "OK"
Test #17:
score: 5
Accepted
time: 530ms
memory: 11896kb
input:
26 14
output:
OK
result:
ok "OK"
Test #18:
score: 5
Accepted
time: 717ms
memory: 20092kb
input:
27 14
output:
OK
result:
ok "OK"
Test #19:
score: 5
Accepted
time: 651ms
memory: 20004kb
input:
27 15
output:
OK
result:
ok "OK"
Test #20:
score: 5
Accepted
time: 610ms
memory: 20200kb
input:
27 16
output:
OK
result:
ok "OK"