結果
| 問題 |
No.3012 岩井星人グラフ
|
| コンテスト | |
| ユーザー |
biotea
|
| 提出日時 | 2025-01-25 13:36:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 355 ms / 2,000 ms |
| コード長 | 651 bytes |
| コンパイル時間 | 1,548 ms |
| コンパイル使用メモリ | 161,048 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-25 22:51:52 |
| 合計ジャッジ時間 | 8,977 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
// #include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll inf = (1LL << 61);
ll dx[4] = {0, 1, 0, -1};
ll dy[4] = {-1, 0, 1, 0};
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define REP(i, init, n) for (ll i = (ll)init; i < (ll)(n); ++i)
// ll op(ll a, ll b) { return max(a, b); }
// ll e() { return -inf; }
int main() {
ll x, y;
cin >> x >> y;
ll N = x * y;
cout << N << " " << N << endl;
ll c = 1;
rep(i, x) {
rep(j, y - 1) {
cout << c << " " << c + 1 << endl;
++c;
}
++c;
}
rep(i, x) { cout << y * i + 1 << " " << (y * i + y + 1) % (x * y) << endl; }
}
biotea