QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#400387 | #8217. King's Dinner | redpanda | WA | 1ms | 3640kb | C++20 | 2.4kb | 2024-04-27 10:49:46 | 2024-04-27 10:49:47 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define vll vector<ll>
#define pb push_back
#define vp vector<pll>
#define tc ll t; cin >> t; for(ll i = 0; i < t; i++){solve(i, t);}
#define tc1 solve(1, 1);
#define mpvll map<ll, vll>
#define vfast vll a(n); for (ll i = 0; i < n; i++) { cin >> a[i]; }
#define mpll map<ll,ll>
#define pll pair<ll,ll>
#define vll2 vector<vector<ll>> dp(n, vector<ll>(m));b
#define FIXED(A) cout << fixed; cout.precision(20); cout << A << "\n";
#define mp(A, B) make_pair(A, B)
#define all(x) (x).begin(), (x).end()
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define sz(x) (int)(x).size()
#define big __int128
#define F first
#define S second
#define ckmin(a,b) a = min(a,b)
#define ckmax(a,b) a = max(a,b)
template <typename num_t>
using indexed_set = tree<num_t, null_type, less<num_t>, rb_tree_tag, tree_order_statistics_node_update>;
void setIO(string name) {freopen((name+".in").c_str(),"r",stdin);freopen((name+".out").c_str(),"w",stdout);}
ll rd(ll a, ll b){return (a+b-1) / b;}
ll isqrt(ll x){ll ans = 0; for(ll k = 1LL << 30; k != 0; k /= 2){if ((ans + k) * (ans + k) <= x) {ans += k;} } return ans; }
vll prime(ll x){ll n = x; vll ans; while (n % 2 == 0) {ans.pb(2);n = n/2;} for (int i = 3; i <= sqrt(n); i = i + 2) {while (n % i == 0){ans.pb(i);n = n/i;}}if (n > 2){ans.pb(n);} return ans;}
ll binpow(ll a, ll b, ll m) { a %= m; ll res = 1; while (b > 0) { if (b & 1){res = res * a % m;}a = a * a % m; b >>= 1;} return res;}
ll lg2(ll n){ll cnt=0;while(n){cnt++;n/=2;}return cnt;}
void solve(ll TC, ll TC2) {
ll n; cin >> n;
if(n==1){
cout << ".\n"; return;
}
auto c2 = [&](){
vector<vector<char>> c(n, vector<char>(n, '.'));
ll cnt = 0;
for(ll i = 0; i < n-1; i+=3){
for(ll j = 0+(i%4==2); j < n; j+=2){
c[i][j]='#'; c[i+1][j]='#'; cnt++;
}
}
return make_pair(cnt, c);
};
auto[cnt, ans] = c2();
for(auto cc: ans){
for(auto c: cc){cout << c;}
cout << '\n';
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
tc
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3640kb
input:
3 1 2 3
output:
. #. #. #.# #.# ...
result:
ok all tests correct (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3512kb
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)