結果

問題 No.938 賢人を探せ
ユーザー otamay6otamay6
提出日時 2019-12-01 17:39:04
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 180,508 KB
実行使用メモリ 6,180 KB
最終ジャッジ日時 2023-08-21 03:30:38
合計ジャッジ時間 3,281 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
6,180 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 21 ms
6,064 KB
testcase_09 AC 19 ms
4,828 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 30 ms
5,916 KB
testcase_12 AC 22 ms
4,604 KB
testcase_13 AC 22 ms
4,600 KB
testcase_14 AC 22 ms
4,620 KB
testcase_15 AC 22 ms
4,608 KB
testcase_16 AC 22 ms
4,556 KB
testcase_17 AC 22 ms
4,604 KB
testcase_18 AC 22 ms
4,548 KB
testcase_19 AC 22 ms
4,612 KB
testcase_20 AC 21 ms
4,544 KB
testcase_21 AC 22 ms
4,672 KB
testcase_22 AC 53 ms
6,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;

int main(){
    int N;cin>>N;
    vector<string> A(N),B;
    set<string> st;
    REP(i,N){
        string b;
        cin>>A[i]>>b;
        if(!st.count(b)){
            B.push_back(b);
            st.insert(b);
        }
    }
    sort(All(A));
    REP(i,B.size()){
        int k=lower_bound(All(A),B[i])-A.begin();
        if(k==N||A[k]!=B[i]){
            cout<<B[i]<<endl;
        }
    }
}
0