結果

問題 No.938 賢人を探せ
ユーザー Ogtsn99
提出日時 2019-12-06 20:13:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 953 bytes
コンパイル時間 2,513 ms
コンパイル使用メモリ 178,548 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2024-12-14 11:48:50
合計ジャッジ時間 3,042 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
signed main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    map <string , int> mp;
    vector <string> list(n);
    map <string , int> mp2;
    rep(i,n){
        string s,t; cin>>s>>t;
        mp[s]++;
        list[i] = t;
    }
    rep(i,n){
        if(mp[list[i]] == 0){
            if(mp2[list[i]] == 0){
                cout<<list[i]<<endl;
                mp2[list[i]]++;
            }
        }
    }
}
0