結果

問題 No.2678 Minmax Independent Set (Hack)
ユーザー GOTKAKO
提出日時 2024-03-15 23:34:30
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 2,325 ms
コンパイル使用メモリ 203,060 KB
最終ジャッジ日時 2025-02-20 06:10:13
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1
権限があれば一括ダウンロードができます

ソースコード

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