結果

問題 No.938 賢人を探せ
ユーザー algon_320algon_320
提出日時 2019-12-01 00:30:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 1,658 ms
コンパイル使用メモリ 174,648 KB
実行使用メモリ 7,316 KB
最終ジャッジ日時 2023-08-21 03:27:04
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
7,316 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 22 ms
6,628 KB
testcase_09 AC 22 ms
6,560 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 28 ms
6,432 KB
testcase_12 AC 24 ms
5,376 KB
testcase_13 AC 23 ms
5,372 KB
testcase_14 AC 24 ms
5,372 KB
testcase_15 AC 22 ms
5,428 KB
testcase_16 AC 22 ms
5,332 KB
testcase_17 AC 24 ms
5,292 KB
testcase_18 AC 23 ms
5,324 KB
testcase_19 AC 23 ms
5,284 KB
testcase_20 AC 23 ms
5,448 KB
testcase_21 AC 24 ms
5,432 KB
testcase_22 AC 58 ms
7,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N;
    cin >> N;
    vector<string> names;
    set<string> cheat;
    for (int i = 0; i < N; i++) {
        string s, t;
        cin >> s >> t;
        cheat.insert(s);
        names.push_back(s);
        names.push_back(t);
    }
    for (auto &x : names) {
        if (!cheat.count(x)) {
            cout << x << endl;
            cheat.insert(x);
        }
    }
}
0