QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#101319#4913. 子集匹配FISHER_100 ✓960ms19868kbC++14211b2023-04-29 09:14:502023-04-29 09:14:54

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-29 09:14:54]
  • 评测
  • 测评结果:100
  • 用时:960ms
  • 内存:19868kb
  • [2023-04-29 09:14:50]
  • 提交

answer

#include "hall.h"
int solve(int n, int k, int s) {
	int sum = 0, mx = 0, id;
	for (int i = 0; i < n; i++) {
		sum += ((s >> i) & 1) ? 1 : -1;
		if (sum > mx) id = i, mx = sum;
	}
	return s ^ (1 << id);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

14 8

output:

OK

result:

ok "OK"

Test #2:

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

input:

15 8

output:

OK

result:

ok "OK"

Test #3:

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

input:

15 9

output:

OK

result:

ok "OK"

Test #4:

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

input:

15 10

output:

OK

result:

ok "OK"

Test #5:

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

input:

18 10

output:

OK

result:

ok "OK"

Test #6:

score: 5
Accepted
time: 8ms
memory: 3520kb

input:

19 10

output:

OK

result:

ok "OK"

Test #7:

score: 5
Accepted
time: 7ms
memory: 3408kb

input:

19 11

output:

OK

result:

ok "OK"

Test #8:

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

input:

19 12

output:

OK

result:

ok "OK"

Test #9:

score: 5
Accepted
time: 44ms
memory: 3972kb

input:

22 12

output:

OK

result:

ok "OK"

Test #10:

score: 5
Accepted
time: 88ms
memory: 4472kb

input:

23 12

output:

OK

result:

ok "OK"

Test #11:

score: 5
Accepted
time: 75ms
memory: 4416kb

input:

23 13

output:

OK

result:

ok "OK"

Test #12:

score: 5
Accepted
time: 53ms
memory: 4508kb

input:

23 14

output:

OK

result:

ok "OK"

Test #13:

score: 5
Accepted
time: 166ms
memory: 5492kb

input:

24 13

output:

OK

result:

ok "OK"

Test #14:

score: 5
Accepted
time: 358ms
memory: 7560kb

input:

25 13

output:

OK

result:

ok "OK"

Test #15:

score: 5
Accepted
time: 326ms
memory: 7580kb

input:

25 14

output:

OK

result:

ok "OK"

Test #16:

score: 5
Accepted
time: 246ms
memory: 7492kb

input:

25 15

output:

OK

result:

ok "OK"

Test #17:

score: 5
Accepted
time: 725ms
memory: 11584kb

input:

26 14

output:

OK

result:

ok "OK"

Test #18:

score: 5
Accepted
time: 948ms
memory: 19832kb

input:

27 14

output:

OK

result:

ok "OK"

Test #19:

score: 5
Accepted
time: 960ms
memory: 19848kb

input:

27 15

output:

OK

result:

ok "OK"

Test #20:

score: 5
Accepted
time: 949ms
memory: 19868kb

input:

27 16

output:

OK

result:

ok "OK"