結果

問題 No.938 賢人を探せ
ユーザー ui_mtcui_mtc
提出日時 2020-04-07 05:12:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 1,586 ms
コンパイル使用メモリ 172,256 KB
実行使用メモリ 6,748 KB
最終ジャッジ日時 2023-08-21 03:44:43
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
6,748 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 16 ms
4,908 KB
testcase_09 AC 17 ms
4,852 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 21 ms
5,052 KB
testcase_12 AC 19 ms
4,784 KB
testcase_13 AC 19 ms
4,848 KB
testcase_14 AC 19 ms
4,824 KB
testcase_15 AC 19 ms
4,972 KB
testcase_16 AC 19 ms
5,012 KB
testcase_17 AC 19 ms
4,836 KB
testcase_18 AC 19 ms
4,824 KB
testcase_19 AC 19 ms
4,796 KB
testcase_20 AC 18 ms
4,780 KB
testcase_21 AC 19 ms
4,824 KB
testcase_22 AC 52 ms
6,640 KB
権限があれば一括ダウンロードができます

ソースコード

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