結果

問題 No.938 賢人を探せ
ユーザー QCFiumQCFium
提出日時 2019-12-01 09:21:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 173,652 KB
実行使用メモリ 6,408 KB
最終ジャッジ日時 2023-08-21 03:29:12
合計ジャッジ時間 3,468 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
6,408 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 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 15 ms
5,892 KB
testcase_09 AC 16 ms
5,412 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 23 ms
6,200 KB
testcase_12 AC 19 ms
5,156 KB
testcase_13 AC 19 ms
5,148 KB
testcase_14 AC 19 ms
5,392 KB
testcase_15 AC 19 ms
5,144 KB
testcase_16 AC 19 ms
5,052 KB
testcase_17 AC 19 ms
5,136 KB
testcase_18 AC 18 ms
5,116 KB
testcase_19 AC 19 ms
5,140 KB
testcase_20 AC 18 ms
5,196 KB
testcase_21 AC 19 ms
5,060 KB
testcase_22 AC 50 ms
6,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
    int n;
    scanf("%d", &n);
    std::pair<std::string, std::string> a[n];
    std::set<std::string> pos;
    for (auto &i : a) {
        std::cin >> i.first >> i.second;
        pos.insert(i.second);
    }
    for (auto &i : a) pos.erase(i.first);
    for (auto &i : a) {
        if (pos.count(i.second)) std::cout << i.second << std::endl, pos.erase(i.second);
    }
    
    return 0;
}
0