結果

問題 No.479 頂点は要らない
ユーザー 夜
提出日時 2021-02-15 21:32:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 1,500 ms
コード長 784 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 96,752 KB
実行使用メモリ 8,952 KB
最終ジャッジ日時 2023-09-30 19:26:34
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,196 KB
testcase_01 AC 3 ms
5,344 KB
testcase_02 AC 4 ms
5,196 KB
testcase_03 AC 3 ms
5,160 KB
testcase_04 AC 3 ms
5,316 KB
testcase_05 AC 3 ms
5,348 KB
testcase_06 AC 3 ms
5,272 KB
testcase_07 AC 3 ms
5,256 KB
testcase_08 AC 3 ms
5,384 KB
testcase_09 AC 3 ms
5,388 KB
testcase_10 AC 3 ms
5,156 KB
testcase_11 AC 3 ms
5,192 KB
testcase_12 AC 3 ms
5,196 KB
testcase_13 AC 3 ms
5,160 KB
testcase_14 AC 3 ms
5,280 KB
testcase_15 AC 2 ms
5,372 KB
testcase_16 AC 4 ms
5,408 KB
testcase_17 AC 3 ms
5,388 KB
testcase_18 AC 2 ms
5,164 KB
testcase_19 AC 4 ms
5,260 KB
testcase_20 AC 4 ms
5,276 KB
testcase_21 AC 3 ms
5,276 KB
testcase_22 AC 4 ms
5,332 KB
testcase_23 AC 4 ms
5,156 KB
testcase_24 AC 3 ms
5,264 KB
testcase_25 AC 4 ms
5,352 KB
testcase_26 AC 81 ms
8,556 KB
testcase_27 AC 78 ms
8,472 KB
testcase_28 AC 68 ms
8,952 KB
testcase_29 AC 66 ms
7,344 KB
testcase_30 AC 67 ms
7,236 KB
testcase_31 AC 67 ms
7,336 KB
testcase_32 AC 66 ms
7,216 KB
testcase_33 AC 66 ms
7,444 KB
testcase_34 AC 69 ms
7,572 KB
testcase_35 AC 61 ms
7,048 KB
testcase_36 AC 35 ms
6,316 KB
testcase_37 AC 70 ms
7,496 KB
testcase_38 AC 58 ms
7,284 KB
testcase_39 AC 41 ms
7,040 KB
testcase_40 AC 51 ms
7,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
bool bo[100010] = { false };
vector<vector<int>> vec(100010);
int main() {
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		vec[a].emplace_back(b);
		vec[b].emplace_back(a);
	}
	for (int i = n - 1; i >= 0; i--) {
		if (!bo[i]) {
			for (int j = 0; j < vec[i].size(); j++) {
				bo[vec[i][j]] = true;
			}
		}
	}
	bool bo1 = false;
	for (int i = n - 1; i >= 0; i--) {
		if (bo[i]) {
			bo1 = true;
		}
		if (bo1) {
			cout << bo[i];
		}
	}
	cout << endl;
}
0