QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#650477#8217. King's Dinnerucup-team3160#WA 1ms3652kbC++141.9kb2024-10-18 15:19:522024-10-18 15:19:53

Judging History

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

  • [2024-10-18 15:19:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3652kb
  • [2024-10-18 15:19:52]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i, min, max) for(int i = (min); i <= (max); ++i)
#define nrep(i, max, min) for(int i = (max); i >= (min); --i)
#define reads(str) (scanf("%s", str + 1), strlen(str + 1))
#define case() int Ts = read(); rep(T, 1, Ts)
#define putf(flag) puts((flag) ? "Yes" : "No")
#define put(x) printf("%d ", x)
#define putl(x) printf("%lld ", x)
#define endl() putchar('\n')
using namespace std;

void print() { cerr << endl; }
template<typename T, typename ...Ts>
void print(T x, Ts ...xs) { cerr << x << " "; print(xs...); }

typedef long long ll;
inline ll read()
{
    ll now=0; bool nev=false; char c=getchar();
    while(c<'0' || c>'9') { if(c=='-') nev=true; c=getchar(); }
    while(c>='0' && c<='9') { now=(now<<1)+(now<<3)+(c&15); c=getchar(); }
    return nev?-now:now;
}

const int N = 200 + 10;

int a[N][N];

int main() {
    case() {
        int n = read(), n0 = n, ax = 0, ay = 0;
        rep(i, 1, n) rep(j, 1, n) a[i][j] = 0;
        while(n > 1 && n % 3 == 1) {
            rep(i, 1, n - 1) if(i % 3 != 0) {
                a[1 + ax][i + ay] = a[i + ax][n + ay] = a[n + ax][n - i + 1 + ay] = a[n - i + 1 + ax][1 + ay] = 1;
            }
            ax += 2, ay += 2;
            n -= 4;
        }
        int xlim = n, ylim = n;
        while((xlim + 1) % 3 != 0) xlim --;
        while((ylim + 1) % 2 != 0) ylim --;
        rep(i, 1, n) {
            rep(j, 1, n) {
                if(j % 2 != 0 && i % 3 != 0 && i <= xlim && j <= ylim) {
                    a[i + ax][j + ay] = 1;
                }
            }
        }
        if(n % 3 == 1) rep(i, 1, xlim) if(i % 3 != 0) a[n + ax][i + ay] = 1;
        n = n0;
        rep(i, 1, n) {
            rep(j, 1, n) {
                if(a[i][j]) putchar('#');
                else putchar('.');
            }
            putchar('\n');
        }
            // putchar('\n');
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1
2
3

output:

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

result:

ok all tests correct (3 test cases)

Test #2:

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

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 = 8, pans = 6 (test case 6)