結果
問題 |
No.1831 Parasol
|
ユーザー |
![]() |
提出日時 | 2021-12-01 22:45:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 1,509 ms |
コンパイル使用メモリ | 171,300 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 11:22:51 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(int i=0;i<n;i++) #define riano_ std::ios::sync_with_stdio(false);std::cin.tie(nullptr) int main() { riano_; ll ans = 0; ll N; cin >> N; cout << 2*N-1 << endl; vector<vector<ll>> a(2*N-1,vector<ll>(N)); rep(i,N){ int s = 2*i+1; rep(j,s) a[j][i] = s; int k = 2*N-1-s; rep(j,k) a[j+s][i] = k; } rep(i,2*N-1){ rep(j,N){ cout << a[i][j] << " "; } cout << endl; } //cout << ans << endl; }