結果

問題 No.3012 岩井星人グラフ
ユーザー Shizen
提出日時 2025-01-25 20:18:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 1,655 ms
コンパイル使用メモリ 164,280 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-26 00:06:29
合計ジャッジ時間 8,346 ms
ジャッジサーバーID
(参考情報)
judge7 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int x,y;
    cin >> x >> y;
    cout << x*y << " " << x*y << endl;

    vector<int>head (x);
    for(int i=0;i<x;i++)head[i] = i+1;

    int now = x;
    for(int i=0;i<x;i++){
        cout << head[i]  << " " << head[(i+1)%x] << endl;
        for(int j=0;j<y-1;j++){
            now++;
            if(j==0) cout << head[i];
            else cout << now-1;
            cout << " " << now << endl;
        }
    }
}
0