QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#519879#6668. Trokutibykem0 8ms3732kbC++202.5kb2024-08-15 08:43:402024-08-15 08:43:41

Judging History

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

  • [2024-08-15 08:43:41]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:3732kb
  • [2024-08-15 08:43:40]
  • 提交

answer

#include <algorithm>
#include <chrono>
#include <iostream>
#include <random>
#include <vector>

using namespace std;

mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());

const int kN = 101;
const int kM[10][10] = {{2, 2, 2, -1, -1, -1, -1, -1, -1, 2}, {2, -1, -1, 2, 2, -1, -1, -1, 2, -1}, {-1, 2, -1, 2, -1, 2, -1, 2, -1, -1}, {-1, -1, 2, -1, 2, 2, 2, -1, -1, -1}, {2, -1, -1, -1, -1, 2, 2, 2, -1, -1}, {-1, 2, -1, -1, 2, -1, 2, -1, 2, -1}, {-1, -1, 2, 2, -1, -1, -1, 2, 2, -1}, {-1, -1, 2, 2, -1, -1, 2, -1, -1, 2}, {-1, 2, -1, -1, 2, -1, -1, 2, -1, 2}, {2, -1, -1, -1, -1, 2, -1, -1, 2, 2}};

int n = kN - 1;
bool e[kN][kN];
vector<int> p;
int b[10];

int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  for (int i = 1, c = 0; i <= 5; ++i) {
    for (int j = i + 1; j <= 5; ++j) {
      for (int k = j + 1; k <= 5; ++k) {
        cout << "? " << i << ' ' << j << ' ' << k << endl;
        cin >> b[c++];
      }
    }
  }
  for (int i = 1, c = 0; i <= 5; ++i) {
    for (int j = i + 1; j <= 5; ++j) {
      int s = 0;
      for (int k = 0; k < 10; ++k) {
        s += b[k] * kM[c][k];
      }
      e[i][j] = e[j][i] = s / 6;
      ++c;
    }
  }
  p = {1, 2, 3, 4, 5};
  for (int i = 6; i <= n; ++i) {
    shuffle(p.begin(), p.end(), rnd);
    int j = 0;
    for (; j + 1 < p.size();) {
      int r = j;
      for (; r + 1 < p.size(); ++r) {
        cout << "? " << i << ' ' << p[r] << ' ' << p[r + 1] << endl;
        int v;
        cin >> v;
        v -= e[p[r]][p[r + 1]];
        if (v != 1) {
          e[i][p[r]] = e[i][p[r + 1]] = v / 2;
          e[p[r]][i] = e[p[r + 1]][i] = v / 2;
          break;
        }
      }
      if (r == p.size() - 1) {
        cout << "? " << i << ' ' << p[0] << ' ' << p[2] << endl;
        int v;
        cin >> v;
        v -= e[p[0]][p[2]];
        for (int k = 0; k < p.size(); ++k) {
          e[i][p[k]] = e[p[k]][i] = (v / 2) ^ (k & 1);
        }
        break;
      }
      for (int k = r; k > j; --k) {
        e[i][p[k - 1]] = e[p[k - 1]][i] = !e[i][p[k]];
      }
      j = r + 2;
    }
    if (j == p.size() - 1) {
      cout << "? " << i << ' ' << p[0] << ' ' << p[j] << endl;
      int v;
      cin >> v;
      e[i][p[j]] = e[p[j]][i] = v - e[i][p[0]] - e[p[0]][p[j]];
    }
    p.push_back(i);
  }
  cout << '!' << endl;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cout << e[i][j];
    }
    cout << '\n';
  }
  cout.flush();
  return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 100
Accepted
time: 3ms
memory: 3652kb

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:

? 1 2 3
? 1 2 4
? 1 2 5
? 1 3 4
? 1 3 5
? 1 4 5
? 2 3 4
? 2 3 5
? 2 4 5
? 3 4 5
? 6 1 3
? 6 2 5
? 6 1 4
? 7 2 4
? 7 5 6
? 7 1 3
? 8 6 7
? 8 1 3
? 8 5 2
? 8 6 4
? 9 5 7
? 9 1 2
? 9 3 4
? 9 8 6
? 10 7 1
? 10 6 5
? 10 8 4
? 10 3 2
? 10 7 9
? 11 5 6
? 11 7 8
? 11 2 9
? 11 4 1
? 11 3 10
? 12 2 3
? 12 7 1...

result:

points 1.0 points  1.0 correct 2504 queries

Test #2:

score: 100
Accepted
time: 8ms
memory: 3732kb

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:

? 1 2 3
? 1 2 4
? 1 2 5
? 1 3 4
? 1 3 5
? 1 4 5
? 2 3 4
? 2 3 5
? 2 4 5
? 3 4 5
? 6 1 2
? 6 4 5
? 6 1 3
? 7 1 2
? 7 4 6
? 7 3 5
? 8 4 3
? 8 6 1
? 8 5 7
? 8 4 2
? 9 1 3
? 9 6 2
? 9 4 5
? 9 8 7
? 10 7 9
? 10 6 5
? 10 2 8
? 10 4 1
? 10 7 3
? 11 7 10
? 11 5 3
? 11 8 9
? 11 2 4
? 11 1 6
? 12 2 5
? 12 6 1...

result:

points 1.0 points  1.0 correct 2504 queries

Test #3:

score: 100
Accepted
time: 0ms
memory: 3732kb

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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 2
? 8 6 3
? 9 2 3
? 9 8 5
? 9 4 1
? 9 7 6
? 10 1 3
? 10 8 7
? 10 6 5
? 10 4 2
? 10 1 9
? 11 2 6
? 11 7 8
? 11 3 1
? 11 10 5
? 11 9 4
? 12 3 8
? 12 6 7...

result:

points 1.0 points  1.0 correct 2505 queries

Test #5:

score: 100
Accepted
time: 0ms
memory: 3640kb

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
1
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
...

output:

? 1 2 3
? 1 2 4
? 1 2 5
? 1 3 4
? 1 3 5
? 1 4 5
? 2 3 4
? 2 3 5
? 2 4 5
? 3 4 5
? 6 3 4
? 6 5 2
? 6 3 1
? 7 5 1
? 7 4 6
? 7 3 2
? 8 6 3
? 8 1 4
? 8 7 2
? 8 6 5
? 9 7 6
? 9 5 8
? 9 1 2
? 9 4 3
? 10 6 2
? 10 5 8
? 10 7 4
? 10 1 9
? 10 6 3
? 11 8 7
? 11 10 4
? 11 3 2
? 11 5 9
? 11 6 1
? 12 1 5
? 12 8 7...

result:

points 1.0 points  1.0 correct 2511 queries

Test #6:

score: 100
Accepted
time: 0ms
memory: 3664kb

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
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 7 8
? 10 1 9
? 10 9 6
? 10 6 3
? 10 2 5
? 11 7 6
? 11 8 5
? 11...

result:

wrong answer the graph you report is incorrect