結果

問題 No.3727 Garden Master
コンテスト
ユーザー 李柏霆
提出日時 2026-09-19 15:33:42
言語 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
結果
AC  
実行時間 20 ms / 2,000 ms
+ 594µs
コード長 519 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,007 ms
コンパイル使用メモリ 351,772 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-09-19 15:33:51
合計ジャッジ時間 4,753 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 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)%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)%2 == 1) cout << i << " ";
            else cout << j << " ";
        }
        cout << '\n';
    }
}
0