結果

問題 No.938 賢人を探せ
ユーザー ei13337ei13337
提出日時 2019-12-01 00:02:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 677 bytes
コンパイル時間 1,090 ms
コンパイル使用メモリ 91,496 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2023-08-21 03:24:00
合計ジャッジ時間 2,212 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
6,824 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 14 ms
5,452 KB
testcase_09 AC 14 ms
5,440 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 18 ms
5,364 KB
testcase_12 AC 16 ms
4,860 KB
testcase_13 AC 16 ms
4,836 KB
testcase_14 AC 16 ms
4,832 KB
testcase_15 AC 17 ms
4,880 KB
testcase_16 AC 16 ms
4,856 KB
testcase_17 AC 16 ms
4,860 KB
testcase_18 AC 16 ms
4,872 KB
testcase_19 AC 16 ms
4,872 KB
testcase_20 AC 16 ms
5,012 KB
testcase_21 AC 17 ms
4,856 KB
testcase_22 AC 49 ms
6,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <iomanip>
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    set<string> a;
    vector<string> b;
    for(int i = 0; i < n; i++) {
        string s1, s2;
        cin >> s1 >> s2;
        a.insert(s1);
        b.push_back(s2);
    }
    for(int i = 0; i < (int)b.size(); i++) {
        if(!a.count(b[i])) {
            a.insert(b[i]);
            cout << b[i] << endl;
        }
    }
    return 0;
}
0