QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#506409#4912. WereYouLastLCat900 1ms4980kbC++14366b2024-08-05 17:14:272024-08-05 17:14:28

Judging History

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

  • [2024-08-05 17:14:28]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:4980kb
  • [2024-08-05 17:14:27]
  • 提交

answer

// 
bool query(int);

void modify(int, bool);

bool WereYouLast(int n, int m) {
	int x = 0;
	for (int i = 0; i < 5; i++) x |= query(i + 1) << i;
	if ((1 << x) == n) return true;
//	bool f = query(x + 6);
//	modify(x + 6, !f);
//	if (f || (1 << x + 1) == n) 
	x++;
//	else x = 0;
	for (int i = 0; i < 5; i++) modify(i + 1, x >> i & 1);
	return false;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3824kb

input:

1024 10

output:

12345876 -3 11
12345876 -3 11

result:

wrong answer Wrong Answer At Query 11.

Subtask #2:

score: 0
Wrong Answer

Test #2:

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

input:

65536 100000

output:

12345876 -3 17
12345876 -3 17

result:

wrong answer Wrong Answer At Query 17.

Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

1048576 100000

output:

12345876 -3 21
12345876 -3 21

result:

wrong answer Wrong Answer At Query 21.

Subtask #4:

score: 0
Wrong Answer

Test #4:

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

input:

67108864 100000

output:

12345876 -3 27
12345876 -3 27

result:

wrong answer Wrong Answer At Query 27.