結果

問題 No.938 賢人を探せ
ユーザー jxkokojxkoko
提出日時 2019-12-01 16:14:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 785 bytes
コンパイル時間 2,990 ms
コンパイル使用メモリ 156,308 KB
実行使用メモリ 8,344 KB
最終ジャッジ日時 2023-08-21 03:30:31
合計ジャッジ時間 3,895 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
8,344 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 24 ms
6,228 KB
testcase_09 AC 24 ms
6,036 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 32 ms
6,884 KB
testcase_12 AC 25 ms
5,556 KB
testcase_13 AC 25 ms
5,764 KB
testcase_14 AC 25 ms
5,544 KB
testcase_15 AC 24 ms
5,664 KB
testcase_16 AC 24 ms
5,724 KB
testcase_17 AC 24 ms
5,916 KB
testcase_18 AC 25 ms
5,668 KB
testcase_19 AC 25 ms
5,604 KB
testcase_20 AC 24 ms
5,920 KB
testcase_21 AC 25 ms
5,660 KB
testcase_22 AC 60 ms
8,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<pair<int, int>, int> PP;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
//------------------------------------------------------------------------------------------------------------------------------

int main(void) { 
    int N;
    cin >> N;
    vector<string> V;
    map<string, bool> cheat,print;
    for (int i = 0; i < N; i++) {
        string a, b;
        cin >> a >> b;
        cheat[a] = true;
        V.push_back(b);
    }
    for (auto itr = V.begin(); itr != V.end(); itr++) {
        if (!print[*itr] && !cheat[*itr]){
            cout << *itr << endl;
            print[*itr] = true;
        }
    }
}
0