結果

問題 No.1587 012 Matrix
ユーザー chocoruskchocorusk
提出日時 2021-07-08 22:36:49
言語 C++17
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 965 bytes
コンパイル時間 2,981 ms
使用メモリ 4,572 KB
最終ジャッジ日時 2023-02-01 18:46:52
合計ジャッジ時間 4,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
4,472 KB
testcase_01 AC 3 ms
4,480 KB
testcase_02 AC 2 ms
4,476 KB
testcase_03 AC 2 ms
4,532 KB
testcase_04 AC 2 ms
4,412 KB
testcase_05 AC 2 ms
4,572 KB
testcase_06 AC 2 ms
4,512 KB
testcase_07 AC 2 ms
4,556 KB
testcase_08 AC 2 ms
4,408 KB
testcase_09 AC 2 ms
4,404 KB
testcase_10 AC 3 ms
4,480 KB
testcase_11 AC 3 ms
4,560 KB
testcase_12 AC 4 ms
4,560 KB
testcase_13 AC 5 ms
4,488 KB
testcase_14 AC 7 ms
4,412 KB
testcase_15 AC 9 ms
4,520 KB
testcase_16 AC 11 ms
4,536 KB
testcase_17 AC 13 ms
4,564 KB
testcase_18 AC 13 ms
4,412 KB
testcase_19 AC 15 ms
4,416 KB
testcase_20 AC 15 ms
4,484 KB
testcase_21 AC 15 ms
4,484 KB
testcase_22 AC 2 ms
4,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int ans[505][505]={};
    int n; cin>>n;
    for(int i=0; i<n/2; i++){
        for(int j=i; j<=n-1-i; j++){
            ans[n-1-i][j]=2;
            ans[j][n-1-i]=2;
        }
        ans[i][n-1-i]=1;
    }
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            cout<<ans[i][j];
        }
        cout<<endl;
    }
    return 0;
}
0