QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#320282 | #8217. King's Dinner | ucup-team133# | WA | 1ms | 3572kb | C++23 | 1.5kb | 2024-02-03 15:12:04 | 2024-02-03 15:12:04 |
Judging History
answer
#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void(0)
#endif
using namespace std;
typedef long long ll;
#define all(x) begin(x), end(x)
constexpr int INF = (1 << 30) - 1;
constexpr long long IINF = (1LL << 60) - 1;
constexpr int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
template <class T> istream& operator>>(istream& is, vector<T>& v) {
for (auto& x : v) is >> x;
return is;
}
template <class T> ostream& operator<<(ostream& os, const vector<T>& v) {
auto sep = "";
for (const auto& x : v) os << exchange(sep, " ") << x;
return os;
}
template <class T, class U = T> bool chmin(T& x, U&& y) { return y < x and (x = forward<U>(y), true); }
template <class T, class U = T> bool chmax(T& x, U&& y) { return x < y and (x = forward<U>(y), true); }
template <class T> void mkuni(vector<T>& v) {
sort(begin(v), end(v));
v.erase(unique(begin(v), end(v)), end(v));
}
template <class T> int lwb(const vector<T>& v, const T& x) { return lower_bound(begin(v), end(v), x) - begin(v); }
void solve() {
int n;
cin >> n;
if (n == 1) {
cout << ".\n";
return;
}
vector<string> ans(n, string(n, '.'));
for (int i = 0; i + 1 < n; i += 3) {
for (int j = 0; j < n; j += 2) {
ans[i][j] = ans[i + 1][j] = '#';
}
}
for (int i = 0; i < n; i++) cout << ans[i] << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
for (; t--;) solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
3 1 2 3
output:
. #. #. #.# #.# ...
result:
ok all tests correct (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3572kb
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 = 2 (test case 4)