結果

問題 No.939 and or
ユーザー QCFium
提出日時 2019-12-02 09:24:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 1,565 ms
コンパイル使用メモリ 175,244 KB
実行使用メモリ 818,048 KB
最終ジャッジ日時 2024-11-23 16:50:09
合計ジャッジ時間 9,839 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 3 RE * 25 MLE * 2
権限があれば一括ダウンロードができます

ソースコード

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