結果

問題 No.839 Keep Distance and Nobody Explodes
ユーザー xuzijian629xuzijian629
提出日時 2019-06-14 22:41:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 192,656 KB
最終ジャッジ日時 2025-01-07 04:35:13
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int ans[300][300];

int main() {
    int n;
    cin >> n;

    int t = 0;
    for (int i = 0; i < n / 2; i++) {
        for (int j = 0; j < n / 2; j++) {
            ans[n - 1 - i][j] = t++;
            ans[n / 2 - 1 - i][n / 2 + j] = t++;
        }
    }
    for (int i = 0; i < n / 2; i++) {
        for (int j = 0; j < n / 2; j++) {
            ans[j][i] = t++;
            ans[n / 2 + j][n / 2 + i] = t++;
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << ans[i][j] << ' ';
        }
        cout << '\n';
    }
    cout << endl;
}
0