QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#865786 | #4912. WereYouLast | duongnc000 | 10 | 1ms | 5376kb | C++23 | 524b | 2025-01-21 22:44:16 | 2025-01-21 22:44:17 |
Judging History
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.