結果

問題 No.479 頂点は要らない
ユーザー sugim48sugim48
提出日時 2017-01-27 22:37:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 84 ms / 1,500 ms
コード長 1,148 bytes
コンパイル時間 1,753 ms
コンパイル使用メモリ 103,620 KB
実行使用メモリ 8,780 KB
最終ジャッジ日時 2023-08-25 04:08:36
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 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 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,380 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 81 ms
8,536 KB
testcase_27 AC 84 ms
8,500 KB
testcase_28 AC 69 ms
8,780 KB
testcase_29 AC 67 ms
5,900 KB
testcase_30 AC 67 ms
5,908 KB
testcase_31 AC 68 ms
5,884 KB
testcase_32 AC 68 ms
5,904 KB
testcase_33 AC 70 ms
6,168 KB
testcase_34 AC 75 ms
6,652 KB
testcase_35 AC 64 ms
5,144 KB
testcase_36 AC 36 ms
4,380 KB
testcase_37 AC 76 ms
6,840 KB
testcase_38 AC 63 ms
5,864 KB
testcase_39 AC 46 ms
5,520 KB
testcase_40 AC 54 ms
6,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
using namespace std;

#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
int INF = INT_MAX / 10;
double EPS = 1e-10;

int main() {
	int N, M; cin >> N >> M;
	vector<vector<int> > G(N);
	while (M--) {
		int u, v; cin >> u >> v;
		G[u].pb(v); G[v].pb(u);
	}
	vector<bool> a(N);
	for (int u = N - 1; u >= 0; u--)
		for (int v: G[u])
			if (v > u && !a[v])
				a[u] = true;
	bool unko = false;
	for (int u = N - 1; u >= 0; u--) {
		if (a[u]) unko = true;
		if (unko) cout << a[u];
	}
	cout << endl;
}
0