結果

問題 No.3727 Garden Master
コンテスト
ユーザー 李柏霆
提出日時 2026-09-19 15:31:29
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 539 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,889 ms
コンパイル使用メモリ 350,788 KB
実行使用メモリ 9,928 KB
最終ジャッジ日時 2026-09-19 15:31:41
合計ジャッジ時間 6,953 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    //start here
    int N;cin >> N;
    for(int i = 1;i <= N;i++){
        for(int j = 1;j <= N;j++){
            if((i+j + (i > j))%2 == 0) cout << i << " ";
            else cout << j << " ";
        }
        cout << '\n';
    }
    for(int i = 1;i <= N;i++){
        for(int j = 1;j <= N;j++){
            if((i+j + (i > j))%2 == 1) cout << i << " ";
            else cout << j << " ";
        }
        cout << '\n';
    }
}
0