結果

問題 No.839 Keep Distance and Nobody Explodes
ユーザー kimiyukikimiyuki
提出日時 2019-06-18 11:40:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,583 bytes
コンパイル時間 1,840 ms
コンパイル使用メモリ 198,532 KB
最終ジャッジ日時 2025-01-07 04:56:19
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) begin(x), end(x)
#define dump(x) cerr << #x " = " << x << endl
using ll = long long;
using namespace std;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
template <class T, class U> inline void chmax(T & a, U const & b) { a = max<T>(a, b); }
template <class T, class U> inline void chmin(T & a, U const & b) { a = min<T>(a, b); }
template <typename X, typename T> auto make_vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_vectors(X x, Y y, Z z, Zs... zs) { auto cont = make_vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }
template <typename T> ostream & operator << (ostream & out, vector<T> const & xs) { REP (i, (int)xs.size() - 1) out << xs[i] << ' '; if (not xs.empty()) out << xs.back(); return out; }

int main() {
    int n; cin >> n;
    auto f = make_vectors(n, n, int());
    int next = 1;
    REP (y, n / 2) {
        REP (x, n / 2) {
            f[y][x] = next ++;
            f[n / 2 + y][n / 2 + x] = next ++;
        }
    }
    REP (y, n / 2) {
        REP (x, n / 2) {
            f[y][n / 2 + x] = next ++;
            f[n / 2 + y][x] = next ++;
        }
    }
    REP (y, n) {
        cout << f[y] << endl;
    }
    return 0;
}
0