結果

問題 No.938 賢人を探せ
ユーザー ui_mtc
提出日時 2020-04-07 05:12:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 175,176 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-12-14 11:58:56
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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);
  }
  
  set<string> ans;
  for( int i = 0; i < N; i++ ){
    if( A.count(B.at(i)) ) continue;
    else{
      if( ans.count(B.at(i)) ) continue;
      else{
        cout << B.at(i) << endl;
        ans.insert(B.at(i));
      }
    }
  }
  
}

0