結果
問題 |
No.1831 Parasol
|
ユーザー |
|
提出日時 | 2022-02-05 03:05:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 2,338 ms |
コンパイル使用メモリ | 196,208 KB |
最終ジャッジ日時 | 2025-01-27 20:20:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 1 WA * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main () { int N; cin >> N; int M = N * 2 - 1; cout << M << endl; vector<int> ans; for (int i = M; i >= N; i --) { for (int j = 0; j < i; j ++) { ans.push_back(i); } if (i < M) { for (int j = 0; j < M - i; j ++) { ans.push_back(M - i); } } } for (int i = 0; i < M; i ++) { for (int j = 0; j < N; j ++) { cout << ans[i + j * M] << (j < N - 1 ? " " : ""); } cout << endl; } }