結果
問題 | No.938 賢人を探せ |
ユーザー |
|
提出日時 | 2020-08-15 06:28:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 3,287 ms |
コンパイル使用メモリ | 199,420 KB |
最終ジャッジ日時 | 2025-01-13 01:05:38 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; set<string> ng; vector<string> cand(n); REP (i, n) { string tmp; cin >> tmp >> cand[i]; ng.insert(tmp); } REP (i, n) { if (!ng.count(cand[i])) { cout << cand[i] << endl; ng.insert(cand[i]); // remove dupilicate } } return 0; }