結果
| 問題 | No.3727 Garden Master |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-19 14:56:18 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 22 ms / 2,000 ms |
| + 769µs | |
| コード長 | 737 bytes |
| 記録 | |
| コンパイル時間 | 2,463 ms |
| コンパイル使用メモリ | 338,032 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-19 14:56:26 |
| 合計ジャッジ時間 | 4,629 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector a(n, vector<int>(n));
vector b(n, vector<int>(n));
rep(i, n) rep(j, n) {
a[i][j] = i + 1;
b[i][j] = j + 1;
}
rep(i, n) rep(j, n) {
if (i < j)
continue;
if ((i + j) % 2) {
swap(a[i][j], a[j][i]);
swap(b[i][j], b[j][i]);
}
}
rep(i, n) {
rep(j, n) cout << a[i][j] << " ";
cout << endl;
}
rep(i, n) {
rep(j, n) cout << b[i][j] << " ";
cout << endl;
}
return 0;
}