結果
問題 | No.1169 Row and Column and Diagonal |
ユーザー | 🍮かんプリン |
提出日時 | 2020-08-14 21:27:26 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 1,277 ms |
コンパイル使用メモリ | 162,388 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-10 14:02:18 |
合計ジャッジ時間 | 2,393 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.08.14 21:27:22 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n;cin >> n; vector<vector<int>> ans(n,vector<int>(n)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { ans[(i+j)%n][(i-j+n)%n] = i+1; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << ans[i][j] << " "; } cout << endl; } return 0; }