結果
問題 |
No.1587 012 Matrix
|
ユーザー |
![]() |
提出日時 | 2021-07-04 13:54:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 532 ms |
コンパイル使用メモリ | 65,316 KB |
実行使用メモリ | 7,252 KB |
最終ジャッジ日時 | 2024-07-01 12:36:35 |
合計ジャッジ時間 | 4,545 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 22 |
ソースコード
#include <iostream> using namespace std; int N, A[1009][1009]; int main() { cin >> N; if (N % 2 == 1) { cout << "No" << endl; } else if (N % 2 == 0) { for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { if (i + j < N + 1) { A[i][j] = 0; } else if (i + j == N + 1) { if (i <= (N / 2)) A[i][j] = 1; else A[i][j] = 2; } else { A[i][j] = 2; } } } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) cout << A[i][j]; cout << endl; } } return 0; }