結果

問題 No.938 賢人を探せ
ユーザー ππ
提出日時 2019-12-14 00:53:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 1,823 ms
コンパイル使用メモリ 153,460 KB
実行使用メモリ 6,768 KB
最終ジャッジ日時 2023-08-21 03:37:40
合計ジャッジ時間 3,139 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
6,768 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 17 ms
5,316 KB
testcase_09 AC 18 ms
5,456 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 22 ms
5,412 KB
testcase_12 AC 17 ms
4,880 KB
testcase_13 AC 16 ms
4,788 KB
testcase_14 AC 17 ms
5,048 KB
testcase_15 AC 17 ms
4,812 KB
testcase_16 AC 16 ms
4,884 KB
testcase_17 AC 17 ms
4,796 KB
testcase_18 AC 17 ms
4,792 KB
testcase_19 AC 17 ms
4,812 KB
testcase_20 AC 17 ms
4,760 KB
testcase_21 AC 17 ms
5,048 KB
testcase_22 AC 27 ms
6,760 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