結果

問題 No.3012 岩井星人グラフ
ユーザー it_is_a_pity_
提出日時 2025-01-25 20:05:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 648 bytes
コンパイル時間 3,247 ms
コンパイル使用メモリ 220,396 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2025-01-26 00:06:06
合計ジャッジ時間 10,548 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define all(v) v.begin(),v.end()
const ll INF = (ll)2e18;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll X, Y;
    cin >> X >> Y;
    cout << X * Y << ' ' << X * Y << endl;
    ll N = X * Y;
    vector<vector<ll>> G(N);
    
    rep(i,X){
        cout << i + 1 << ' ' << (i + 1) % X + 1 << endl;
    }
    rep(i,Y-1){
        rep(j,X){
            cout << (i + 1) * X + j + 1 << ' ' << i * X + j + 1 << endl;
        }
    }
}
0