結果

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

ソースコード

diff #

#include <bits/stdc++.h>

int main()
{
    int x, y;
    std::cin >> x >> y;
    std::cout << x * y << " " << x * y << std::endl;
    int count = 1;
    for (int i = 1; i <= x; ++i) {
        if (i != x) std::cout << i << " " << i + 1 << std::endl;
        else std::cout << i << " " << 1 << std::endl;
        count++;
    }
    for (int i = 1; i <= x; ++i) {
        for (int j = 1; j < y; ++j) {
            if (j == 1) std::cout << i << " " << count << std::endl;
            else std::cout << count - 1 << " " << count << std::endl;
            count++;
        }
    }
}
0