結果

問題 No.938 賢人を探せ
ユーザー tactac
提出日時 2019-12-20 20:33:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 1,053 bytes
コンパイル時間 1,769 ms
コンパイル使用メモリ 173,152 KB
実行使用メモリ 7,796 KB
最終ジャッジ日時 2023-08-21 03:41:06
合計ジャッジ時間 2,932 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
7,788 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 16 ms
5,404 KB
testcase_09 AC 17 ms
5,408 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 21 ms
6,016 KB
testcase_12 AC 19 ms
5,408 KB
testcase_13 AC 20 ms
5,376 KB
testcase_14 AC 19 ms
5,488 KB
testcase_15 AC 19 ms
5,428 KB
testcase_16 AC 19 ms
5,356 KB
testcase_17 AC 19 ms
5,360 KB
testcase_18 AC 19 ms
5,548 KB
testcase_19 AC 19 ms
5,484 KB
testcase_20 AC 19 ms
5,540 KB
testcase_21 AC 19 ms
5,368 KB
testcase_22 AC 52 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define INF (ll)(1e18)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }



int main() {
    int n;
    cin >> n;
    vector<string> a(n), b(n);
    rep(i, n) cin >> a[i] >> b[i];
    
    set<string> s;
    rep(i, n) s.insert(a[i]);
    
    set<string> used;
    rep(i, n) {
        if (!s.count(b[i]) && !used.count(b[i])) { cout << b[i] << endl; used.insert(b[i]); }
    }
    
}
0