結果

問題 No.479 頂点は要らない
ユーザー sugarrrsugarrr
提出日時 2018-07-22 09:16:22
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 78 ms / 1,500 ms
コード長 1,231 bytes
コンパイル時間 842 ms
コンパイル使用メモリ 76,644 KB
実行使用メモリ 8,984 KB
最終ジャッジ日時 2023-08-27 00:49:37
合計ジャッジ時間 4,416 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,384 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 77 ms
8,884 KB
testcase_27 AC 78 ms
8,896 KB
testcase_28 AC 65 ms
8,984 KB
testcase_29 AC 65 ms
6,436 KB
testcase_30 AC 65 ms
6,444 KB
testcase_31 AC 66 ms
6,408 KB
testcase_32 AC 66 ms
6,440 KB
testcase_33 AC 60 ms
6,648 KB
testcase_34 AC 68 ms
6,836 KB
testcase_35 AC 59 ms
5,596 KB
testcase_36 AC 33 ms
4,388 KB
testcase_37 AC 64 ms
7,072 KB
testcase_38 AC 56 ms
6,476 KB
testcase_39 AC 40 ms
5,892 KB
testcase_40 AC 47 ms
6,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=1000000000000;/*10^12*/
#define rep(i,l,r) for(ll i=l;i<=r;i++)
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}


//////////////////////////////////////

int main(){
    int n,m;cin>>n>>m;
    vector<int> e[n];
    rep(i,0,m-1){
        int a,b;cin>>a>>b;
        e[a].push_back(b);
        e[b].push_back(a);
    }
    bool deleted[n];memset(deleted,false,sizeof(deleted));
    for(int v=n-1;v>=0;v--){
        bool flag=true;
        for(auto x:e[v]){
            if(deleted[x])flag=false;
        }
        if(flag)deleted[v]=true;
    }
    int pos=n-1;
    while(pos>=0&&deleted[pos])pos--;
    while(pos>=0){
        if(!deleted[pos])cout<<1;
        else cout<<0;
        pos--;
    }
    cout<<endl;
    
    return 0;
}
0