QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394264#4913. 子集匹配hswfwkj5 908ms19964kbC++14234b2024-04-20 10:38:302024-04-20 10:38:31

Judging History

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

  • [2024-04-20 10:38:31]
  • 评测
  • 测评结果:5
  • 用时:908ms
  • 内存:19964kb
  • [2024-04-20 10:38:30]
  • 提交

answer

#include "hall.h"
int solve(int n, int K, int s)
{
	int mn = 0, pos = 0, num = 0;
	for(int i = n - 1; i >= 0; i--)
	{
		if(s >> i & 1) num++;
		else num--;
		if(num <= mn) mn = num, pos = i;
	}
	return s ^ (1 << pos - 1);
}

详细

Test #1:

score: 0
Runtime Error

input:

14 8

output:


result:


Test #2:

score: 0
Runtime Error

input:

15 8

output:


result:


Test #3:

score: 0
Runtime Error

input:

15 9

output:


result:


Test #4:

score: 0
Runtime Error

input:

15 10

output:


result:


Test #5:

score: 0
Runtime Error

input:

18 10

output:


result:


Test #6:

score: 0
Runtime Error

input:

19 10

output:


result:


Test #7:

score: 0
Runtime Error

input:

19 11

output:


result:


Test #8:

score: 0
Runtime Error

input:

19 12

output:


result:


Test #9:

score: 0
Runtime Error

input:

22 12

output:


result:


Test #10:

score: 0
Runtime Error

input:

23 12

output:


result:


Test #11:

score: 0
Runtime Error

input:

23 13

output:


result:


Test #12:

score: 0
Runtime Error

input:

23 14

output:


result:


Test #13:

score: 0
Runtime Error

input:

24 13

output:


result:


Test #14:

score: 0
Runtime Error

input:

25 13

output:


result:


Test #15:

score: 0
Runtime Error

input:

25 14

output:


result:


Test #16:

score: 0
Runtime Error

input:

25 15

output:


result:


Test #17:

score: 0
Runtime Error

input:

26 14

output:


result:


Test #18:

score: 5
Accepted
time: 908ms
memory: 19964kb

input:

27 14

output:

OK

result:

ok "OK"

Test #19:

score: 0
Runtime Error

input:

27 15

output:


result:


Test #20:

score: 0
Runtime Error

input:

27 16

output:


result: