QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394204#4913. 子集匹配zhaohaikun100 ✓596ms20360kbC++20138b2024-04-20 10:17:322024-04-20 10:17:32

Judging History

你现在查看的是最新测评结果

  • [2024-04-20 10:17:32]
  • 评测
  • 测评结果:100
  • 用时:596ms
  • 内存:20360kb
  • [2024-04-20 10:17:32]
  • 提交

answer

#include"hall.h"
int solve(int n,int K,int s){int p=-1,G=0,w=0;for(int i=0;i<n;i++)if((w+=(s>>i&1?-1:1))>=G)p=i,G=w;return s^(1<<(p+1));}

詳細信息

Test #1:

score: 5
Accepted
time: 0ms
memory: 3832kb

input:

14 8

output:

OK

result:

ok "OK"

Test #2:

score: 5
Accepted
time: 1ms
memory: 3956kb

input:

15 8

output:

OK

result:

ok "OK"

Test #3:

score: 5
Accepted
time: 1ms
memory: 3828kb

input:

15 9

output:

OK

result:

ok "OK"

Test #4:

score: 5
Accepted
time: 0ms
memory: 3960kb

input:

15 10

output:

OK

result:

ok "OK"

Test #5:

score: 5
Accepted
time: 2ms
memory: 3660kb

input:

18 10

output:

OK

result:

ok "OK"

Test #6:

score: 5
Accepted
time: 5ms
memory: 3836kb

input:

19 10

output:

OK

result:

ok "OK"

Test #7:

score: 5
Accepted
time: 4ms
memory: 3664kb

input:

19 11

output:

OK

result:

ok "OK"

Test #8:

score: 5
Accepted
time: 3ms
memory: 3884kb

input:

19 12

output:

OK

result:

ok "OK"

Test #9:

score: 5
Accepted
time: 31ms
memory: 4144kb

input:

22 12

output:

OK

result:

ok "OK"

Test #10:

score: 5
Accepted
time: 66ms
memory: 4848kb

input:

23 12

output:

OK

result:

ok "OK"

Test #11:

score: 5
Accepted
time: 48ms
memory: 4848kb

input:

23 13

output:

OK

result:

ok "OK"

Test #12:

score: 5
Accepted
time: 32ms
memory: 4976kb

input:

23 14

output:

OK

result:

ok "OK"

Test #13:

score: 5
Accepted
time: 116ms
memory: 5760kb

input:

24 13

output:

OK

result:

ok "OK"

Test #14:

score: 5
Accepted
time: 266ms
memory: 7784kb

input:

25 13

output:

OK

result:

ok "OK"

Test #15:

score: 5
Accepted
time: 218ms
memory: 7868kb

input:

25 14

output:

OK

result:

ok "OK"

Test #16:

score: 5
Accepted
time: 161ms
memory: 7864kb

input:

25 15

output:

OK

result:

ok "OK"

Test #17:

score: 5
Accepted
time: 520ms
memory: 11852kb

input:

26 14

output:

OK

result:

ok "OK"

Test #18:

score: 5
Accepted
time: 596ms
memory: 20012kb

input:

27 14

output:

OK

result:

ok "OK"

Test #19:

score: 5
Accepted
time: 566ms
memory: 20360kb

input:

27 15

output:

OK

result:

ok "OK"

Test #20:

score: 5
Accepted
time: 584ms
memory: 20360kb

input:

27 16

output:

OK

result:

ok "OK"