結果

問題 No.1587 012 Matrix
ユーザー nawawannawawan
提出日時 2021-07-08 22:33:46
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 418 bytes
コンパイル時間 1,548 ms
使用メモリ 4,428 KB
最終ジャッジ日時 2023-02-01 18:42:58
合計ジャッジ時間 3,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,376 KB
testcase_01 AC 2 ms
3,456 KB
testcase_02 AC 1 ms
3,428 KB
testcase_03 AC 2 ms
3,428 KB
testcase_04 AC 2 ms
3,476 KB
testcase_05 AC 1 ms
3,384 KB
testcase_06 AC 1 ms
3,384 KB
testcase_07 AC 1 ms
3,384 KB
testcase_08 AC 1 ms
3,380 KB
testcase_09 AC 2 ms
3,500 KB
testcase_10 AC 2 ms
3,516 KB
testcase_11 AC 3 ms
3,552 KB
testcase_12 AC 3 ms
3,584 KB
testcase_13 AC 6 ms
3,620 KB
testcase_14 AC 8 ms
3,796 KB
testcase_15 AC 9 ms
3,944 KB
testcase_16 AC 11 ms
4,044 KB
testcase_17 AC 13 ms
4,244 KB
testcase_18 AC 14 ms
4,344 KB
testcase_19 AC 15 ms
4,328 KB
testcase_20 AC 16 ms
4,428 KB
testcase_21 AC 16 ms
4,376 KB
testcase_22 AC 1 ms
3,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<vector<int>> c(N, vector<int>(N));
    for(int i = 0; i < N; i++){
        if(i < N / 2) c[i][N - 1 - i] = 1;
        else c[i][N - 1 - i] = 2;
        for(int j = N - 1; j > N - 1 - i; j--)  c[i][j] = 2;
    }
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++) cout << c[i][j];
        cout << endl;
    }
}
0