結果

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using std::cin;
using std::cout;

int main() {
	int n;
	cin >> n;

	int x = 0;
	rep(i, n) {
		rep(j, n) {
			if (i + j < n - 1)
				cout << 2;
			else if (i + j > n - 1)
				cout << 0;
			else if (i < j)
				cout << 2;
			else cout << 1;
		}
		puts("");
	}

	return 0;
}
0