結果

問題 No.938 賢人を探せ
ユーザー ianCKianCK
提出日時 2019-12-10 04:00:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 810 ms
コンパイル使用メモリ 69,796 KB
実行使用メモリ 6,972 KB
最終ジャッジ日時 2023-08-21 03:36:51
合計ジャッジ時間 2,315 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
6,972 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 15 ms
5,476 KB
testcase_09 AC 15 ms
5,416 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 20 ms
5,476 KB
testcase_12 AC 16 ms
5,076 KB
testcase_13 AC 16 ms
4,896 KB
testcase_14 AC 18 ms
4,872 KB
testcase_15 AC 16 ms
4,892 KB
testcase_16 AC 17 ms
5,128 KB
testcase_17 AC 17 ms
4,884 KB
testcase_18 AC 16 ms
4,872 KB
testcase_19 AC 16 ms
4,888 KB
testcase_20 AC 16 ms
4,872 KB
testcase_21 AC 17 ms
4,860 KB
testcase_22 AC 52 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
#include <vector>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	string s;
	set<string> bad;
	vector<string> good;
	cin >> n;
	while (n--) {
		cin >> s;
		bad.insert(s);
		cin >> s;
		good.push_back(s);
	}
	for (string i : good) if (bad.find(i) == bad.end()) {
		cout << i << endl;
		bad.insert(i);
	}
}
0