結果
問題 | No.839 Keep Distance and Nobody Explodes |
ユーザー |
![]() |
提出日時 | 2019-06-14 22:42:12 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 645 bytes |
コンパイル時間 | 1,715 ms |
コンパイル使用メモリ | 194,296 KB |
最終ジャッジ日時 | 2025-01-07 04:35:33 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; int ans[300][300]; int main() { int n; cin >> n; int t = 0; for (int i = 0; i < n / 2; i++) { for (int j = 0; j < n / 2; j++) { ans[n - 1 - i][j] = t++; ans[n / 2 - 1 - i][n / 2 + j] = t++; } } for (int i = 0; i < n / 2; i++) { for (int j = 0; j < n / 2; j++) { ans[j][i] = t++; ans[n / 2 + j][n / 2 + i] = t++; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << ans[i][j] + 1 << ' '; } cout << '\n'; } cout << endl; }