QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#320829 | #8217. King's Dinner | ucup-team296# | AC ✓ | 1ms | 3900kb | C++14 | 1.8kb | 2024-02-03 22:08:16 | 2024-02-03 22:08:17 |
Judging History
answer
#include <bits/stdc++.h>
#define long long long int
#define DEBUG
using namespace std;
// @author: pashka
void fill1(vector<string> &a, int x1, int x2, int y1, int y2) {
for (int i = x1; i + 1 < x2; i += 3) {
for (int j = y1; j < y2; j += 2) {
a[i][j] = a[i + 1][j] = '#';
}
}
}
void fill2(vector<string> &a, int x1, int x2, int y1, int y2) {
for (int i = x1; i < x2; i += 2) {
for (int j = y1; j + 1 < y2; j += 3) {
a[i][j] = a[i][j + 1] = '#';
}
}
}
struct test {
void solve() {
int n;
cin >> n;
vector<string> a(n, string(n, '.'));
if (n % 2 == 1) {
if (n % 3 == 2) {
fill1(a, 0, n, 0, n);
} else if (n % 3 == 1) {
fill1(a, 0, n - 1, 0, n);
fill2(a, n - 1, n, 0, n);
} else {
fill1(a, 0, n - 3, 0, n);
fill2(a, n - 3, n, 0, n);
}
} else {
if (n % 3 == 2) {
fill1(a, 0, n, 0, n - 2);
fill1(a, 0, 2, 0, n);
fill2(a, 3, n, n - 2, n);
} else if (n % 3 == 1) {
fill1(a, 0, n - 2, 0, n - 3);
fill1(a, n - 2, n, n - 1, n);
fill2(a, 0, n - 3, n - 2, n);
fill2(a, n - 1, n, 0, n - 2);
} else {
fill1(a, 0, n - 4, 0, n - 3);
fill1(a, n - 2, n, n - 3, n);
fill2(a, 0, n - 3, n - 2, n);
fill2(a, n - 3, n, 0, n - 3);
}
}
for (auto &s : a) {
cout << s << "\n";
}
}
};
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
test().solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3880kb
input:
3 1 2 3
output:
. #. #. ##. ... ##.
result:
ok all tests correct (3 test cases)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3600kb
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:
ok all tests correct (50 test cases)
Test #3:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
39 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
output:
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# ................................................... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# ...........................................
result:
ok all tests correct (39 test cases)
Test #4:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
11 90 91 92 93 94 95 96 97 98 99 100
output:
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.## #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#... ........................................................................................## #.#.#.#.#.#.#.#.#.#.#.#.#.#...
result:
ok all tests correct (11 test cases)
Test #5:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
1 100
output:
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.## #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#... .....................................................................................................
result:
ok all tests correct (1 test case)
Extra Test:
score: 0
Extra Test Passed