結果
| 問題 | No.938 賢人を探せ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-03 21:20:15 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 2,000 ms |
| コード長 | 465 bytes |
| 記録 | |
| コンパイル時間 | 1,099 ms |
| コンパイル使用メモリ | 182,948 KB |
| 実行使用メモリ | 8,064 KB |
| 最終ジャッジ日時 | 2026-05-25 06:07:56 |
| 合計ジャッジ時間 | 2,886 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n;
cin >> n;
string a[20010], b[20010];
set<string> s;
for(int i = 0;i < n;i++){
cin >> a[i] >> b[i];
s.insert(a[i]);
}
set<string> t;
for(int i = 0;i < n;i++){
if(s.find(b[i]) == s.end() && t.find(b[i]) == t.end()){
cout << b[i] << endl;
t.insert(b[i]);
}
}
return 0;
}