QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187662#4912. WereYouLastCrysfly10 5035ms5124kbC++20602b2023-09-24 20:11:582023-09-24 20:11:58

Judging History

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

  • [2023-09-24 20:11:58]
  • 评测
  • 测评结果:10
  • 用时:5035ms
  • 内存:5124kb
  • [2023-09-24 20:11:58]
  • 提交

answer

// what is matter? never mind. 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)

bool query(int);
void modify(int,bool);

bool WereYouLast(int n,int m){
	if(n==(1<<10)){
		int p=1;
		while(p<=10 && query(p)) modify(p,0),++p;
		if(p==11)return 1;
		modify(p,1);
		return 0;
	}
	int t=0,x=0;
	For(i,0,4)if(query(i+1))t|=(1<<i);
	if((1<<t)==n)return 1;
	bool bo=query(t+6);
	if(!bo) modify(t+6,1),t=0;
	else modify(t+6,0),t++;
	For(i,0,4) modify(i+1,t>>i&1);
	return 0;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3824kb

input:

1024 10

output:

12345876 10 10

result:

ok Correct Answer.
C1 = 10.
C2 = 10.

Subtask #2:

score: 0
Wrong Answer

Test #2:

score: 0
Wrong Answer
time: 6ms
memory: 5064kb

input:

65536 100000

output:

12345876 -3 65536
12345876 -3 65536

result:

wrong answer Wrong Answer At Query 65536.

Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

1048576 100000

output:

12345876 -3 1048576
12345876 -3 1048576

result:

wrong answer Wrong Answer At Query 1048576.

Subtask #4:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 5035ms
memory: 4984kb

input:

67108864 100000

output:

12345876 -3 67108864
12345876 -3 67108864

result:

wrong answer Wrong Answer At Query 67108864.