結果
| 問題 |
No.1169 Row and Column and Diagonal
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-14 22:06:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 68,576 KB |
| 最終ジャッジ日時 | 2025-01-12 23:53:48 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <iostream>
#include <vector>
void solve() {
int n;
std::cin >> n;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
std::cout << (i * 2 - j + n) % n + 1 << " ";
}
std::cout << "\n";
}
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}