結果

問題 No.479 頂点は要らない
ユーザー confconf
提出日時 2017-01-27 22:57:52
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 150 ms / 1,500 ms
コード長 662 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 78,576 KB
実行使用メモリ 17,720 KB
最終ジャッジ日時 2023-08-25 04:30:46
合計ジャッジ時間 3,912 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,032 KB
testcase_01 AC 4 ms
8,052 KB
testcase_02 AC 4 ms
8,056 KB
testcase_03 AC 4 ms
8,100 KB
testcase_04 AC 4 ms
8,104 KB
testcase_05 AC 5 ms
8,116 KB
testcase_06 AC 3 ms
8,200 KB
testcase_07 AC 3 ms
8,096 KB
testcase_08 AC 4 ms
8,064 KB
testcase_09 AC 3 ms
8,052 KB
testcase_10 AC 5 ms
8,272 KB
testcase_11 AC 4 ms
8,060 KB
testcase_12 AC 4 ms
8,032 KB
testcase_13 AC 3 ms
8,072 KB
testcase_14 AC 4 ms
8,300 KB
testcase_15 AC 4 ms
8,016 KB
testcase_16 AC 4 ms
8,056 KB
testcase_17 AC 4 ms
8,020 KB
testcase_18 AC 4 ms
8,268 KB
testcase_19 AC 5 ms
8,280 KB
testcase_20 AC 5 ms
8,272 KB
testcase_21 AC 5 ms
8,252 KB
testcase_22 AC 5 ms
8,168 KB
testcase_23 AC 5 ms
8,232 KB
testcase_24 AC 5 ms
8,152 KB
testcase_25 AC 5 ms
8,256 KB
testcase_26 AC 99 ms
17,496 KB
testcase_27 AC 100 ms
17,568 KB
testcase_28 AC 102 ms
17,488 KB
testcase_29 AC 84 ms
17,472 KB
testcase_30 AC 86 ms
17,440 KB
testcase_31 AC 84 ms
17,720 KB
testcase_32 AC 83 ms
17,492 KB
testcase_33 AC 110 ms
15,956 KB
testcase_34 AC 120 ms
16,720 KB
testcase_35 AC 150 ms
17,028 KB
testcase_36 AC 86 ms
14,056 KB
testcase_37 AC 110 ms
16,392 KB
testcase_38 AC 91 ms
15,328 KB
testcase_39 AC 59 ms
13,112 KB
testcase_40 AC 65 ms
14,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    set<int> G[100000];
    bool B[100000];
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        G[a].insert(b);
        G[b].insert(a);
    }
    fill(B,B+n,true);
    for(int i=n-1;i>=0;i--){
        B[i]=false;
        for(auto to:G[i]){
            if(B[to]==false){
                B[i]=true;
                break;
            }
        }
    }
    bool flag = false;
    for(int i=n-1;i>=0;i--){
        if(B[i])flag=true,cout<<'1';
        else if(flag)cout<<'0';
    }
    cout<<endl;
    return 0;
}
0