結果
問題 | No.938 賢人を探せ |
ユーザー |
|
提出日時 | 2019-12-01 09:03:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 934 ms |
コンパイル使用メモリ | 82,732 KB |
実行使用メモリ | 7,888 KB |
最終ジャッジ日時 | 2024-12-14 11:42:45 |
合計ジャッジ時間 | 2,283 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include<iostream>#include<vector>#include<map>#include<set>using namespace std;int main(){set<string> a;set<string> b;vector<string> v;int n;cin >> n;for(int i = 0; i < n; i++){string x, y;cin >> x >> y;if(a.count(x)==0&&b.count(x)==0) v.push_back(x);if(a.count(y)==0&&b.count(y)==0) v.push_back(y);a.insert(x);b.insert(y);}for(string s : v) if(a.count(s)==0) cout << s << endl;return 0;}