QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#124278 | #6668. Trokuti | bashkort# | 0 | 10ms | 8080kb | C++20 | 2.9kb | 2023-07-14 16:25:39 | 2024-07-04 00:39:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 rnd(228);
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n = 100;
vector mp(n, vector(n, vector<int>(n, -1)));
vector e(n, vector<int>(n, -1));
for (int i = 0; i < n; ++i) {
e[i][i] = 0;
}
auto ask = [&](array<int, 3> a) {
sort(a.begin(), a.end());
if (mp[a[0]][a[1]][a[2]] == -1) {
cout << "? " << a[0] + 1 << " " << a[1] + 1 << " " << a[2] + 1 << endl;
cin >> mp[a[0]][a[1]][a[2]];
}
return mp[a[0]][a[1]][a[2]];
};
int qwq = 1, s = 0, t = 0;
for (; qwq <= 1e4; ++qwq) {
array<int, 3> a;
for (int i = 0; i < 3; ++i) {
a[i] = rnd() % n;
bool ok = true;
for (int j = 0; j < i; ++j) {
ok &= a[i] != a[j];
}
if (!ok) {
i -= 1;
}
}
if (int x = ask(a); x == 0 || x == 3) {
s = a[0], t = a[1];
for (int i = 0; i < 3; ++i) {
for (int j = i + 1; j < 3; ++j) {
e[a[i]][a[j]] = e[a[j]][a[i]] = bool(x);
}
}
break;
}
}
assert(qwq <= 5000);
vector<int> a[2];
int swp = -1;
for (int x = 0; x < n; ++x) {
if (e[s][x] != -1) {
continue;
}
int c = ask({s, t, x});
if (c - e[s][t] == 2 || c - e[s][t] == 0) {
e[s][x] = e[t][x] = e[x][t] = e[x][s] = c > e[s][t];
continue;
}
if (a[0].empty() && a[1].empty()) {
a[0].push_back(x);
continue;
}
for (int i = 0; i < 2; ++i) {
if (!a[i].empty()) {
int xa = a[i].back();
if (ask({x, xa, s}) == ask({x, xa, t})) {
a[i ^ 1].push_back(x);
break;
}
} else {
a[i].push_back(x);
break;
}
}
}
for (int i = 0; i < 2 && swp == -1; ++i) {
if (size(a[i]) > 1) {
if (ask({a[i][0], a[i][1], s}) >= 2) {
swp = i;
break;
}
}
}
for (int i = 0; i < 2 && swp != -1; ++i) {
for (int x : a[i ^ swp]) {
e[x][s] = e[s][x] = 1;
e[x][t] = e[t][x] = 0;
}
}
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
if (i == s || j == s) {
continue;
}
e[i][j] = e[j][i] = ask({s, i, j}) - e[s][i] - e[s][j];
}
}
cout << "!\n";
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << e[i][j];
}
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 34.471
Acceptable Answer
time: 7ms
memory: 7632kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 74 76 97 ? 1 74 97 ? 2 74 97 ? 3 74 97 ? 4 74 97 ? 5 74 97 ? 6 74 97 ? 7 74 97 ? 8 74 97 ? 9 74 97 ? 10 74 97 ? 11 74 97 ? 12 74 97 ? 13 74 97 ? 14 74 97 ? 15 74 97 ? 16 74 97 ? 17 74 97 ? 18 74 97 ? 19 74 97 ? 20 74 97 ? 21 74 97 ? 22 74 97 ? 23 74 97 ? 24 74 97 ? 25 74 97 ? 26 74 97 ? 27 74 97 ?...
result:
points 0.34470967740 points 0.34470967740 correct 4851 queries
Test #2:
score: 34.471
Acceptable Answer
time: 10ms
memory: 7756kb
input:
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ...
output:
? 74 76 97 ? 1 74 97 ? 2 74 97 ? 3 74 97 ? 4 74 97 ? 5 74 97 ? 6 74 97 ? 7 74 97 ? 8 74 97 ? 9 74 97 ? 10 74 97 ? 11 74 97 ? 12 74 97 ? 13 74 97 ? 14 74 97 ? 15 74 97 ? 16 74 97 ? 17 74 97 ? 18 74 97 ? 19 74 97 ? 20 74 97 ? 21 74 97 ? 22 74 97 ? 23 74 97 ? 24 74 97 ? 25 74 97 ? 26 74 97 ? 27 74 97 ?...
result:
points 0.34470967740 points 0.34470967740 correct 4851 queries
Test #3:
score: 34.471
Acceptable Answer
time: 5ms
memory: 7696kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 74 76 97 ? 1 74 97 ? 2 74 97 ? 3 74 97 ? 4 74 97 ? 5 74 97 ? 6 74 97 ? 7 74 97 ? 8 74 97 ? 9 74 97 ? 10 74 97 ? 11 74 97 ? 12 74 97 ? 13 74 97 ? 14 74 97 ? 15 74 97 ? 16 74 97 ? 17 74 97 ? 18 74 97 ? 19 74 97 ? 20 74 97 ? 21 74 97 ? 22 74 97 ? 23 74 97 ? 24 74 97 ? 25 74 97 ? 26 74 97 ? 27 74 97 ?...
result:
points 0.34470967740 points 0.34470967740 correct 4851 queries
Test #4:
score: 34.471
Acceptable Answer
time: 0ms
memory: 7752kb
input:
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ...
output:
? 74 76 97 ? 1 74 97 ? 2 74 97 ? 3 74 97 ? 4 74 97 ? 5 74 97 ? 6 74 97 ? 7 74 97 ? 8 74 97 ? 9 74 97 ? 10 74 97 ? 11 74 97 ? 12 74 97 ? 13 74 97 ? 14 74 97 ? 15 74 97 ? 16 74 97 ? 17 74 97 ? 18 74 97 ? 19 74 97 ? 20 74 97 ? 21 74 97 ? 22 74 97 ? 23 74 97 ? 24 74 97 ? 25 74 97 ? 26 74 97 ? 27 74 97 ?...
result:
points 0.34470967740 points 0.34470967740 correct 4851 queries
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 8080kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 74 76 97 ? 1 74 97 ? 2 74 97 ? 3 74 97 ? 4 74 97 ? 5 74 97 ? 6 74 97 ? 7 74 97 ? 8 74 97 ? 9 74 97 ? 10 74 97 ? 11 74 97 ? 12 74 97 ? 13 74 97 ? 14 74 97 ? 15 74 97 ? 16 74 97 ? 17 74 97 ? 18 74 97 ? 19 74 97 ? 20 74 97 ? 21 74 97 ? 22 74 97 ? 23 74 97 ? 24 74 97 ? 25 74 97 ? 26 74 97 ? 27 74 97 ?...
result:
wrong answer Token parameter [name=ans_i] equals to "000000000000000000000000000000...0000000000000000000002000000000", doesn't correspond to pattern "[01]{100,100}"