結果
問題 |
No.938 賢人を探せ
|
ユーザー |
![]() |
提出日時 | 2020-04-07 05:09:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 527 bytes |
コンパイル時間 | 1,895 ms |
コンパイル使用メモリ | 178,568 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 10:43:42 |
合計ジャッジ時間 | 3,208 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 10 |
ソースコード
#include <bits/stdc++.h> #define int long long using namespace std; const int MOD = 1000000007; signed main() { int N; cin >> N; set<string> A; vector<string> B(N); for( int i = 0; i < N; i++ ){ string a; cin >> a >> B.at(i); A.insert(a); } vector<string> ans; for( int i = 0; i < N; i++ ){ if( A.count(B.at(i)) ) continue; else ans.push_back(B.at(i)); } ans.erase(unique(ans.begin(), ans.end()), ans.end()); for( int i = 0; i < ans.size(); i++ ) cout << ans.at(i) << endl; }