QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#741625#8217. King's Dinnerucup-team3646WA 1ms4316kbC++202.3kb2024-11-13 14:49:402024-11-13 14:49:40

Judging History

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

  • [2024-11-13 14:49:40]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4316kb
  • [2024-11-13 14:49:40]
  • 提交

answer

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

using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep2(i, l, r) for (ll i = l; i < r; i++)

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;

/* ---- */
#define all(A) A.begin(), A.end()
#define elif else if
using pii = pair<ll, ll>;

bool chmin(auto &a, const auto &b) { return a > b ? a = b, 1 : 0; }
bool chmax(auto &a, const auto &b) { return a < b ? a = b, 1 : 0; }

struct IOSetup
{
  IOSetup()
  {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
} iosetup;

template <class T>
void print(vector<T> a)
{
  for (auto x : a)
    cerr << x << ' ';
  cerr << endl;
}

void print(auto x) { cerr << x << endl; }

template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail)
{
  cerr << head << ' ';
  print(forward<Tail>(tail)...);
}

vector<vector<string>> mat(101);

void calc(int n)
{
  mat[n].assign(n, string(n, '.'));
  if (n == 2)
    mat[2] = {"##", ".."};
  if (n == 3)
    mat[3] = {"##.", "...", "##."};
  if (n == 4)
    mat[4] = {"##.#", "...#", "##..", "...."};
  if (n == 5)
    mat[5] = {"##.##", ".....", "##.##", ".....", "##.##"};
  if (n == 6)
    mat[6] = {"##.#.#", "...#.#", "##....", "....##", "#.#...", "#.#.##"};
  if (n == 7)
    mat[7] = {"##.##.#", "......#", "##.##..", "......#", "##.##.#", ".......", "##.##.."};
  if (n <= 7)
    return;
  rep(i, 6) rep(j, 6)
  {
    if (i % 2 == 0 && j % 3 < 2)
      mat[n][i][j] = '#';
  }
  rep2(i, 6, n) rep(j, 6)
  {
    if (i % 2 == 0 && j % 3 < 2)
      mat[n][i][j] = '#';
  }
  rep(i, 6) rep2(j, 6, n)
  {
    if (i % 3 < 2 && j % 2 == 0)
      mat[n][i][j] = '#';
  }
  if (n % 2 == 0)
  {
    mat[n][n - 2][1] = '.';
    mat[n][n - 2][2] = '#';
    mat[n][n - 2][3] = '.';
    mat[n][n - 1][0] = '#';
    mat[n][n - 1][2] = '#';
    mat[n][n - 1][4] = '#';

    mat[n][1][n - 2] = '.';
    mat[n][2][n - 2] = '#';
    mat[n][3][n - 2] = '.';
    mat[n][0][n - 1] = '#';
    mat[n][2][n - 1] = '#';
    mat[n][4][n - 1] = '#';
  }
  rep2(i, 6, n) rep2(j, 6, n) mat[n][i][j] = mat[n - 6][i - 6][j - 6];
  return;
}

int main()
{
  rep2(n, 1, 101) calc(n);
  int T;
  cin >> T;
  rep(i, T)
  {
    int n;
    cin >> n;
    rep(j, n) cout << mat[n][j] << '\n';
  }
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 4312kb

input:

3
1
2
3

output:

.
##
..
##.
...
##.

result:

ok all tests correct (3 test cases)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 4316kb

input:

50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

output:

.
##
..
##.
...
##.
##.#
...#
##..
....
##.##
.....
##.##
.....
##.##
##.#.#
...#.#
##....
....##
#.#...
#.#.##
##.##.#
......#
##.##..
......#
##.##.#
.......
##.##..
##.##.##
........
##.##.##
........
##.##.##
........
#.#.#.##
#.#.#...
##.##.#.#
......#.#
##.##....
......#.#
##.##.#.#
.........
...

result:

wrong answer jury has the better answer: jans = 4, pans = 3 (test case 4)