結果

問題 No.938 賢人を探せ
ユーザー ππ
提出日時 2019-12-14 00:53:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 1,597 ms
コンパイル使用メモリ 168,584 KB
実行使用メモリ 6,992 KB
最終ジャッジ日時 2024-05-08 09:05:36
合計ジャッジ時間 3,020 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
6,992 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 18 ms
6,940 KB
testcase_09 AC 20 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 26 ms
6,940 KB
testcase_12 AC 18 ms
6,940 KB
testcase_13 AC 19 ms
6,940 KB
testcase_14 AC 18 ms
6,944 KB
testcase_15 AC 18 ms
6,940 KB
testcase_16 AC 18 ms
6,940 KB
testcase_17 AC 18 ms
6,940 KB
testcase_18 AC 18 ms
6,940 KB
testcase_19 AC 18 ms
6,940 KB
testcase_20 AC 18 ms
6,940 KB
testcase_21 AC 18 ms
6,944 KB
testcase_22 AC 28 ms
6,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define MOD 1000000007
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;

int main() {
  int n;
  set<string> a;
  vector<string> b;
  cin >> n;
  REP(i, n) {
    string str;
    cin >> str;
    a.insert(str);
    cin >> str;
    b.push_back(str);
  }

  int size = b.size();
  REP(i, size) {
    if(a.find(b[i]) == a.end()) {
      cout << b[i] << '\n';
      a.insert(b[i]);
    }
  }
  return 0;
}
0