QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#865786#4912. WereYouLastduongnc00010 1ms5376kbC++23524b2025-01-21 22:44:162025-01-21 22:44:17

Judging History

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

  • [2025-01-21 22:44:17]
  • 评测
  • 测评结果:10
  • 用时:1ms
  • 内存:5376kb
  • [2025-01-21 22:44:16]
  • 提交

answer

#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define i64 long long
#define isz(x) (int)x.size()
using namespace std;

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

bool WereYouLast(int n, int m) {
	vector<int> a(m);
	int cnt = 0;
	for (int i = 0; i < m; ++i) {
		a[i] = query(i + 1);
		cnt = cnt << 1 | a[i];
	}
	if (++cnt == n) {
		return true;
	}
	for (int i = 0; i < m; ++i) {
		modify(m - i, cnt >> i & 1);
	}
	return false;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

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: 0ms
memory: 5248kb

input:

65536 100000

output:

12345876 -1 -1

result:

wrong answer Too Many Operations.

Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

1048576 100000

output:

12345876 -1 -1

result:

wrong answer Too Many Operations.

Subtask #4:

score: 0
Wrong Answer

Test #4:

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

input:

67108864 100000

output:

12345876 -1 -1

result:

wrong answer Too Many Operations.