結果

問題 No.939 and or
ユーザー QCFiumQCFium
提出日時 2019-12-02 09:24:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 1,511 ms
コンパイル使用メモリ 176,200 KB
実行使用メモリ 813,972 KB
最終ジャッジ日時 2024-05-02 22:03:20
合計ジャッジ時間 3,413 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 MLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

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