QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#308119#6652. 着色ckiseki#WA 19ms13596kbC++20840b2024-01-19 16:13:152024-01-19 16:13:16

Judging History

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

  • [2024-01-19 16:13:16]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:13596kb
  • [2024-01-19 16:13:15]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

constexpr int N = 1024;

int a[N][N];

int main() {
  vector<tuple<int, int, int>> e;
  for (int i = 0; i < 4; ++i)
    e.emplace_back(i, (i + 1) % 4, 0);
  e.emplace_back(0, 2, 1);
  e.emplace_back(1, 3, 1);

  int o = 2;
  for (int n = 8; n <= N; n *= 2) {
    size_t p = e.size();
    for (size_t i = 0; i < p; ++i) {
      auto [u, v, c] = e[i];
      e.emplace_back(u + n / 2, v + n / 2, c);
    }
    for (int i = 0; i < n / 2; ++i) {
      for (int j = n / 2; j < n; ++j) {
        e.emplace_back(i, j, o);
      }
    }
    o += 1;
  }
  for (auto [u, v, c] : e) {
    if (u > v)
      swap(u, v);
    a[u][v] = c;
  }

  int n;
  cin >> n;

  for (int i = 0; i + 1 < n; ++i) {
    for (int j = 1; i + j < n; ++j)
      cout << a[i][i + j] << ' ';
    cout << '\n';
  }

  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2

output:

0 

result:

ok Accepted.

Test #2:

score: -100
Wrong Answer
time: 19ms
memory: 13192kb

input:

1000

output:

0 1 0 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ...

result:

wrong answer Output format error.