結果

問題 No.1587 012 Matrix
ユーザー pockyny
提出日時 2021-07-08 23:04:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 452 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 66,424 KB
最終ジャッジ日時 2025-01-22 19:11:00
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int a[1001][1001];
int main(){
    int i,j,n; cin >> n;
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            if(i<n/2){
                if(i + j>=n) a[i][j] = 1;
            }else{
                if(i + j>=n) a[i][j] = 2;
                else a[i][j] = 1;
            }
        }
    }
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            cout << a[i][j];
        }
        cout << endl;
    }
}
0