結果

問題 No.1169 Row and Column and Diagonal
ユーザー root__786
提出日時 2020-08-14 22:21:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 191,468 KB
最終ジャッジ日時 2025-01-13 00:07:38
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define tezz std::ios::sync_with_stdio(false);std::cout.tie(NULL);std:cin.tie(NULL);

int main() {
    ll n;
    cin>>n;
    ll r=1;
    for(ll i=1;i<=n;i++){
        ll t=r;
        for(ll j=1;j<=n;j++){
            if(r>n) r=1;
            if(i==j){
                cout<<i<<" ";
                continue;
            }
            cout<<r<<" ";
            r++;
            
        }
        cout<<endl;
        r=t+1;
    }
        
}
0