結果

問題 No.2678 Minmax Independent Set (Hack)
ユーザー GOTKAKOGOTKAKO
提出日時 2024-03-15 23:34:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 2,452 ms
コンパイル使用メモリ 209,816 KB
実行使用メモリ 14,188 KB
最終ジャッジ日時 2024-03-15 23:34:34
合計ジャッジ時間 3,637 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

random_device rnd;
mt19937 mt(rnd());

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; N = 65535+65534;
    vector<vector<int>> Graph(N);

    int p = 65535;
    for(int i=0; i<65535; i++){
        if(i*2+1 >= 65535){
            Graph.at(i).push_back(Graph.size());
            Graph.push_back({i});
            N++;
        }
        else{
            Graph.at(i).push_back(p);
            Graph.at(p).push_back(i);
            Graph.at(i*2+1).push_back(p);
            Graph.at(p).push_back(i*2+1);
            p++;

            Graph.at(i).push_back(p);
            Graph.at(p).push_back(i);
            Graph.at(i*2+2).push_back(p);
            Graph.at(p).push_back(i*2+2);
            p++;
        }
    }
    
    cout << N << endl;
    for(int i=0; i<N; i++){
        for(auto to : Graph.at(i)){
            if(to < i) continue;
            cout << i+1 << " " << to+1 << endl;
        }
    }

}
0