結果

問題 No.479 頂点は要らない
ユーザー けーけー
提出日時 2017-04-10 21:58:27
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 116 ms / 1,500 ms
コード長 554 bytes
コンパイル時間 1,601 ms
コンパイル使用メモリ 172,860 KB
実行使用メモリ 27,788 KB
最終ジャッジ日時 2023-09-25 06:54:24
合計ジャッジ時間 6,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 3 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 103 ms
26,300 KB
testcase_27 AC 103 ms
26,184 KB
testcase_28 AC 98 ms
27,788 KB
testcase_29 AC 81 ms
17,928 KB
testcase_30 AC 80 ms
17,980 KB
testcase_31 AC 81 ms
17,972 KB
testcase_32 AC 80 ms
17,876 KB
testcase_33 AC 101 ms
17,548 KB
testcase_34 AC 116 ms
18,224 KB
testcase_35 AC 116 ms
12,988 KB
testcase_36 AC 68 ms
9,176 KB
testcase_37 AC 111 ms
18,980 KB
testcase_38 AC 97 ms
15,804 KB
testcase_39 AC 63 ms
13,916 KB
testcase_40 AC 75 ms
17,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
const int inf=8938103643641919514ll;
const int mod=1000000007ll;
const int dd[]={0,-1,0,1,0};
using namespace std;
int a,b,c,d;
struct Node{
	unordered_set<int> e;
};
Node *p;
bitset<114514> q;
signed main(){
	int i,j,k;
	cin>>a>>b;
	p=new Node[a];
	for(i=0;i<b;i++){
		int u,v;
		cin>>u>>v;
		p[u].e.insert(v);
		p[v].e.insert(u);
	}
	string ans;
	for(i=a-1;i>=0;i--){
		if(!q[i]){
			for(auto x:p[i].e)
				q.set(x);
		}
		ans.push_back(q[i]?'1':'0');
	}
	ans=ans.substr(ans.find('1'));
	cout<<ans<<endl;
}
0