結果

問題 No.3012 岩井星人グラフ
ユーザー ooaiu
提出日時 2025-02-01 20:25:56
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 342 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 3,647 ms
コンパイル使用メモリ 274,072 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-01 20:26:14
合計ジャッジ時間 11,692 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int X, Y;
    cin >> X >> Y;
    cout << X * Y << " " << X * Y << endl;
    for(int i = 0; i < X; i++) {
        cout << (i + 1) << " " << (i + 1) % X + 1 << endl;
    }
    int id = X + 1;
    for(int i = 0; i < X; i++) {
        int p = i + 1;
        for(int j = 1; j < Y; j++) {
            cout << p << " " << id << endl;
            p = id;
            id++;
        }
    }
}
0