QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#741176 | #8217. King's Dinner | ucup-team3646 | WA | 1ms | 3616kb | C++20 | 1.5kb | 2024-11-13 13:41:12 | 2024-11-13 13:41:14 |
Judging History
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)...);
}
void solve()
{
int n;
cin >> n;
if (n == 1)
{
cout << ".\n";
return;
}
vector<string> S(n, string(n, '.'));
if (n % 2 == 0)
{
rep(i, n) rep(j, n)
{
if ((((i / 2) ^ j) & 1) == 0)
S[i][j] = '#';
}
rep(i, n) cout << S[i] << '\n';
return;
}
rep(i, n - 3) rep(j, n)
{
if ((((i / 2) ^ j) & 1) == 0)
S[i][j] = '#';
}
for (int j = 0; j < n; j += 2)
{
S[n - 2][j] = '#';
S[n - 1][j] = '#';
}
rep(i, n)
{
cout << S[i] << '\n';
}
}
int main()
{
int T;
cin >> T;
rep(i, T) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3616kb
input:
3 1 2 3
output:
. #. #. ... #.# #.#
result:
ok all tests correct (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3532kb
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 grid contains two dominoes that are adjacent (test case 4)