QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394273#4913. 子集匹配linweitong75 828ms20312kbC++20210b2024-04-20 10:41:372024-04-20 10:41:37

Judging History

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

  • [2024-04-20 10:41:37]
  • 评测
  • 测评结果:75
  • 用时:828ms
  • 内存:20312kb
  • [2024-04-20 10:41:37]
  • 提交

answer

#include"hall.h"
using namespace std;
int solve(int n,int K,int s){
	int o=0,ss=n,mn=0;
	for (int i=0;i<n;++i){
		int j=((s>>i)&1);
		o+=(j==1?1:(-1));
		if (o<=ss)ss=o,mn=i+1;
	}
	return s^(1<<mn);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

14 8

output:

OK

result:

ok "OK"

Test #2:

score: 0
Wrong Answer
time: 1ms
memory: 3612kb

input:

15 8

output:

WA

result:

wrong answer 1st words differ - expected: 'OK', found: 'WA'

Test #3:

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

input:

15 9

output:

OK

result:

ok "OK"

Test #4:

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

input:

15 10

output:

OK

result:

ok "OK"

Test #5:

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

input:

18 10

output:

OK

result:

ok "OK"

Test #6:

score: 0
Wrong Answer
time: 5ms
memory: 4052kb

input:

19 10

output:

WA

result:

wrong answer 1st words differ - expected: 'OK', found: 'WA'

Test #7:

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

input:

19 11

output:

OK

result:

ok "OK"

Test #8:

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

input:

19 12

output:

OK

result:

ok "OK"

Test #9:

score: 5
Accepted
time: 26ms
memory: 4128kb

input:

22 12

output:

OK

result:

ok "OK"

Test #10:

score: 0
Wrong Answer
time: 74ms
memory: 5264kb

input:

23 12

output:

WA

result:

wrong answer 1st words differ - expected: 'OK', found: 'WA'

Test #11:

score: 5
Accepted
time: 55ms
memory: 4696kb

input:

23 13

output:

OK

result:

ok "OK"

Test #12:

score: 5
Accepted
time: 36ms
memory: 4632kb

input:

23 14

output:

OK

result:

ok "OK"

Test #13:

score: 5
Accepted
time: 113ms
memory: 5804kb

input:

24 13

output:

OK

result:

ok "OK"

Test #14:

score: 0
Wrong Answer
time: 257ms
memory: 8704kb

input:

25 13

output:

WA

result:

wrong answer 1st words differ - expected: 'OK', found: 'WA'

Test #15:

score: 5
Accepted
time: 221ms
memory: 7676kb

input:

25 14

output:

OK

result:

ok "OK"

Test #16:

score: 5
Accepted
time: 148ms
memory: 7904kb

input:

25 15

output:

OK

result:

ok "OK"

Test #17:

score: 5
Accepted
time: 530ms
memory: 11768kb

input:

26 14

output:

OK

result:

ok "OK"

Test #18:

score: 0
Runtime Error

input:

27 14

output:


result:


Test #19:

score: 5
Accepted
time: 828ms
memory: 20312kb

input:

27 15

output:

OK

result:

ok "OK"

Test #20:

score: 5
Accepted
time: 785ms
memory: 20124kb

input:

27 16

output:

OK

result:

ok "OK"