結果

問題 No.479 頂点は要らない
ユーザー kotatsugamekotatsugame
提出日時 2020-02-27 19:30:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 1,500 ms
コード長 472 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 71,032 KB
実行使用メモリ 9,956 KB
最終ジャッジ日時 2024-04-21 17:02:11
合計ジャッジ時間 3,416 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 3 ms
6,944 KB
testcase_02 AC 3 ms
6,944 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 4 ms
6,944 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 3 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 4 ms
6,940 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 4 ms
6,940 KB
testcase_13 AC 3 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 4 ms
6,940 KB
testcase_16 AC 4 ms
6,940 KB
testcase_17 AC 3 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 3 ms
6,940 KB
testcase_20 AC 4 ms
6,944 KB
testcase_21 AC 4 ms
6,940 KB
testcase_22 AC 3 ms
6,944 KB
testcase_23 AC 3 ms
6,940 KB
testcase_24 AC 3 ms
6,940 KB
testcase_25 AC 3 ms
6,940 KB
testcase_26 AC 76 ms
9,800 KB
testcase_27 AC 76 ms
9,904 KB
testcase_28 AC 65 ms
9,956 KB
testcase_29 AC 67 ms
8,576 KB
testcase_30 AC 68 ms
8,528 KB
testcase_31 AC 67 ms
8,576 KB
testcase_32 AC 66 ms
8,576 KB
testcase_33 AC 64 ms
8,704 KB
testcase_34 AC 67 ms
8,712 KB
testcase_35 AC 62 ms
8,320 KB
testcase_36 AC 36 ms
7,572 KB
testcase_37 AC 65 ms
8,876 KB
testcase_38 AC 58 ms
8,576 KB
testcase_39 AC 41 ms
8,064 KB
testcase_40 AC 47 ms
8,672 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;
int N,M;
vector<int>G[1<<17];
bool use[1<<17];
main()
{
	cin>>N>>M;
	for(int i=0;i<M;i++)
	{
		int a,b;cin>>a>>b;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	for(int i=N;i--;)
	{
		bool flag=false;
		for(int v:G[i])
		{
			if(v>i&&!use[v])flag=true;
		}
		use[i]=flag;
	}
	bool zero=false;
	for(int i=N;i--;)
	{
		if(use[i])
		{
			zero=true;
			cout<<1;
		}
		else if(zero)
		{
			cout<<0;
		}
	}
	cout<<endl;
}
0