QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#319230#4912. WereYouLastUnknown150810 1ms5144kbC++20450b2024-02-02 10:33:522024-02-02 10:33:53

Judging History

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

  • [2024-02-02 10:33:53]
  • 评测
  • 测评结果:10
  • 用时:1ms
  • 内存:5144kb
  • [2024-02-02 10:33:52]
  • 提交

answer

// Function signatures
bool query(int);
void modify(int, bool);

// Main function
bool WereYouLast(int n, int m){
	if (n == (1 << 10) && m == 10){
		// Subtask 1
		int crr = 0;
		for (int i = 0; i < m; i++){
			if (query(i+1)) crr += (1 << i);
		}
		if (crr == n-1) return true;
		crr++;
		for (int i = 0; i < m; i++){
			if ((crr >> i) & 1) modify(i+1, true);
			else modify(i+1, false);
		}
		return false;
	}
	return true;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3816kb

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: 1ms
memory: 5144kb

input:

65536 100000

output:

12345876 -3 1
12345876 -3 1

result:

wrong answer Wrong Answer At Query 1.

Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

1048576 100000

output:

12345876 -3 1
12345876 -3 1

result:

wrong answer Wrong Answer At Query 1.

Subtask #4:

score: 0
Wrong Answer

Test #4:

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

input:

67108864 100000

output:

12345876 -3 1
12345876 -3 1

result:

wrong answer Wrong Answer At Query 1.