結果

問題 No.3012 岩井星人グラフ
ユーザー makichan
提出日時 2025-01-25 15:13:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 708 bytes
コンパイル時間 5,455 ms
コンパイル使用メモリ 332,492 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-25 23:42:08
合計ジャッジ時間 10,872 ms
ジャッジサーバーID
(参考情報)
judge13 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::static_modint<998244353>;
// using mint = atcoder::static_modint<1000000007>;
using namespace std;
using namespace atcoder;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};

int main(){
    int x,y;
    cin >> x >> y;
    cout << x*y << " " << x*y << "\n";
    rep(i,0,x){
        int u=i,v=(i+1)%x;
        cout << u+1 << " " << v+1 << "\n";
    }
    int cnt=x+1;
    rep(i,1,x+1){
        int p=i;
        rep(j,0,y-1){
            cout << p << " " << cnt << "\n";
            p=cnt;
            cnt++;
        }
    }
}
0