QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#370470 | #4913. 子集匹配 | dengtingyu | 100 ✓ | 835ms | 20328kb | C++14 | 242b | 2024-03-29 08:40:48 | 2024-03-29 08:40:50 |
Judging History
answer
#include "hall.h"
#include<bits/stdc++.h>
using namespace std;
#define ll int
ll solve(ll n,ll k,ll s){
ll pos=-1,sum=0,an=0;for(int i=0;i<n;i++){
sum+=((s>>i)&1)?-1:1;if(sum>=an)pos=i,an=sum;
}return s^(1<<(pos+1));
}
详细
Test #1:
score: 5
Accepted
time: 1ms
memory: 3788kb
input:
14 8
output:
OK
result:
ok "OK"
Test #2:
score: 5
Accepted
time: 1ms
memory: 3720kb
input:
15 8
output:
OK
result:
ok "OK"
Test #3:
score: 5
Accepted
time: 0ms
memory: 3900kb
input:
15 9
output:
OK
result:
ok "OK"
Test #4:
score: 5
Accepted
time: 1ms
memory: 3556kb
input:
15 10
output:
OK
result:
ok "OK"
Test #5:
score: 5
Accepted
time: 0ms
memory: 3756kb
input:
18 10
output:
OK
result:
ok "OK"
Test #6:
score: 5
Accepted
time: 5ms
memory: 3644kb
input:
19 10
output:
OK
result:
ok "OK"
Test #7:
score: 5
Accepted
time: 4ms
memory: 3960kb
input:
19 11
output:
OK
result:
ok "OK"
Test #8:
score: 5
Accepted
time: 2ms
memory: 4012kb
input:
19 12
output:
OK
result:
ok "OK"
Test #9:
score: 5
Accepted
time: 30ms
memory: 4252kb
input:
22 12
output:
OK
result:
ok "OK"
Test #10:
score: 5
Accepted
time: 67ms
memory: 4952kb
input:
23 12
output:
OK
result:
ok "OK"
Test #11:
score: 5
Accepted
time: 54ms
memory: 4748kb
input:
23 13
output:
OK
result:
ok "OK"
Test #12:
score: 5
Accepted
time: 32ms
memory: 4740kb
input:
23 14
output:
OK
result:
ok "OK"
Test #13:
score: 5
Accepted
time: 122ms
memory: 5832kb
input:
24 13
output:
OK
result:
ok "OK"
Test #14:
score: 5
Accepted
time: 272ms
memory: 7668kb
input:
25 13
output:
OK
result:
ok "OK"
Test #15:
score: 5
Accepted
time: 222ms
memory: 7672kb
input:
25 14
output:
OK
result:
ok "OK"
Test #16:
score: 5
Accepted
time: 166ms
memory: 7648kb
input:
25 15
output:
OK
result:
ok "OK"
Test #17:
score: 5
Accepted
time: 552ms
memory: 11900kb
input:
26 14
output:
OK
result:
ok "OK"
Test #18:
score: 5
Accepted
time: 776ms
memory: 20328kb
input:
27 14
output:
OK
result:
ok "OK"
Test #19:
score: 5
Accepted
time: 835ms
memory: 19960kb
input:
27 15
output:
OK
result:
ok "OK"
Test #20:
score: 5
Accepted
time: 756ms
memory: 20156kb
input:
27 16
output:
OK
result:
ok "OK"