QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394355#4913. 子集匹配OccDreamer100 ✓533ms20148kbC++14253b2024-04-20 13:36:222024-04-20 13:36:23

Judging History

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

  • [2024-04-20 13:36:23]
  • 评测
  • 测评结果:100
  • 用时:533ms
  • 内存:20148kb
  • [2024-04-20 13:36:22]
  • 提交

answer

#include "hall.h"
#include<bits/stdc++.h>

using namespace std;

int solve(int n,int K,int s){
	int now=0, Min=0, pos=-1;
	for(int i=0;i<n;++i){
		if((s>>i)&1) ++now;
		else --now;
		if(now<=Min) Min=now, pos=i;
	}
	return s^(1<<(pos+1));
}

详细

Test #1:

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

input:

14 8

output:

OK

result:

ok "OK"

Test #2:

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

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: 3996kb

input:

15 10

output:

OK

result:

ok "OK"

Test #5:

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

input:

18 10

output:

OK

result:

ok "OK"

Test #6:

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

input:

19 10

output:

OK

result:

ok "OK"

Test #7:

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

input:

19 11

output:

OK

result:

ok "OK"

Test #8:

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

input:

19 12

output:

OK

result:

ok "OK"

Test #9:

score: 5
Accepted
time: 25ms
memory: 4136kb

input:

22 12

output:

OK

result:

ok "OK"

Test #10:

score: 5
Accepted
time: 63ms
memory: 5020kb

input:

23 12

output:

OK

result:

ok "OK"

Test #11:

score: 5
Accepted
time: 46ms
memory: 5012kb

input:

23 13

output:

OK

result:

ok "OK"

Test #12:

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

input:

23 14

output:

OK

result:

ok "OK"

Test #13:

score: 5
Accepted
time: 115ms
memory: 5660kb

input:

24 13

output:

OK

result:

ok "OK"

Test #14:

score: 5
Accepted
time: 251ms
memory: 8080kb

input:

25 13

output:

OK

result:

ok "OK"

Test #15:

score: 5
Accepted
time: 206ms
memory: 8076kb

input:

25 14

output:

OK

result:

ok "OK"

Test #16:

score: 5
Accepted
time: 149ms
memory: 7872kb

input:

25 15

output:

OK

result:

ok "OK"

Test #17:

score: 5
Accepted
time: 461ms
memory: 12168kb

input:

26 14

output:

OK

result:

ok "OK"

Test #18:

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

input:

27 14

output:

OK

result:

ok "OK"

Test #19:

score: 5
Accepted
time: 515ms
memory: 20148kb

input:

27 15

output:

OK

result:

ok "OK"

Test #20:

score: 5
Accepted
time: 503ms
memory: 20044kb

input:

27 16

output:

OK

result:

ok "OK"