結果

問題 No.92 逃走経路
ユーザー sggkshio
提出日時 2018-03-06 08:15:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,067 bytes
コンパイル時間 923 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 20:55:23
合計ジャッジ時間 1,458 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;

//#include<bits/stdc++.h>

long long int f[105][105];

int main() {

	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			f[i][j] = 100000000000;
		}
	}

	int n, m, k;
	cout << 1;
	cin >> n >> m >> k;
	for (int i = 0; i < m; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		f[a][b] = c;
		f[b][a] = c;
	}
	int x = n;
	bool g[105] = {};
	for (int i = 0; i < k; i++) {
		int d;
		cin >> d;
		for (int i = 1; i <= n; i++) {
			if (g[i])continue;
			bool r = 1;
			for (int j = 0; j <= n; j++) {
				if (f[i][j] == d)r = 0;
			}
			if (r) {
				g[i] = 1; x--;
			}
		}
	}
	cout << x << endl;
	for (int i = 1; i <= n; i++) {
		if (g[i])continue;
		cout << i << " ";

	}
	cout << endl;

	return 0;
}
0