結果

問題 No.2678 Minmax Independent Set (Hack)
ユーザー NokonoKotlinNokonoKotlin
提出日時 2024-03-08 21:13:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,045 bytes
コンパイル時間 734 ms
コンパイル使用メモリ 72,636 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-13 20:50:09
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;



// discord の図参照
int main(){
    // パス上の頂点に m-2 個の子をつけて、その先に m 個の子をつけて、さらにその先に 2 つ子を作る
    const int m = 7;
    const int p = 1800;//パスの長さ
    const int root = 1;
    int target = root;
    vector<pair<int,int>> edges;
    for(int x = root + 1 ; x <=root + p ; x++){
        edges.emplace_back(target,x);
        target = x;
    }
    const int r = target;// パスの右端
    for(int x = root ; x <= r ; x++){
        for(int c = 1 ; c<= m-2 ;c++){
            edges.emplace_back(x,target+c);
            target += c;
            for(int d = 1 ; d <= m ; d++){
                edges.emplace_back(target,target+1);
                edges.emplace_back(target+1,target+2);
                edges.emplace_back(target+1,target+3);
            }
        }
    }

    cout << (edges.size())+1 << endl;
    for(pair<int,int> e :edges)cout << e.first << " " << e.second << endl;
    return 0;
}

0