結果

問題 No.938 賢人を探せ
ユーザー Y17Y17
提出日時 2020-02-03 21:20:15
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 1,926 ms
コンパイル使用メモリ 151,280 KB
実行使用メモリ 7,784 KB
最終ジャッジ日時 2023-08-21 03:43:38
合計ジャッジ時間 3,359 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
7,784 KB
testcase_01 AC 3 ms
4,732 KB
testcase_02 AC 2 ms
4,636 KB
testcase_03 AC 2 ms
4,580 KB
testcase_04 AC 3 ms
4,680 KB
testcase_05 AC 3 ms
4,560 KB
testcase_06 AC 3 ms
4,656 KB
testcase_07 AC 3 ms
4,788 KB
testcase_08 AC 16 ms
5,940 KB
testcase_09 AC 18 ms
5,948 KB
testcase_10 AC 3 ms
4,672 KB
testcase_11 AC 22 ms
6,484 KB
testcase_12 AC 20 ms
5,944 KB
testcase_13 AC 20 ms
6,048 KB
testcase_14 AC 20 ms
5,964 KB
testcase_15 AC 20 ms
6,048 KB
testcase_16 AC 20 ms
5,940 KB
testcase_17 AC 20 ms
6,000 KB
testcase_18 AC 20 ms
6,108 KB
testcase_19 AC 20 ms
5,996 KB
testcase_20 AC 20 ms
6,260 KB
testcase_21 AC 20 ms
6,140 KB
testcase_22 AC 54 ms
7,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
    int n;
    cin >> n;
    string a[20010], b[20010];
    
    set<string> s;
    for(int i = 0;i < n;i++){
        cin >> a[i] >> b[i];
        s.insert(a[i]);
    }

    set<string> t;

    for(int i = 0;i < n;i++){
        if(s.find(b[i]) == s.end() && t.find(b[i]) == t.end()){
            cout << b[i] << endl; 
            t.insert(b[i]);
        }
    }

    return 0;
}
0