結果

問題 No.938 賢人を探せ
ユーザー ransewhale
提出日時 2019-12-08 06:41:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 1,933 ms
コンパイル使用メモリ 174,636 KB
実行使用メモリ 13,668 KB
最終ジャッジ日時 2024-12-14 11:49:39
合計ジャッジ時間 3,245 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, char> P;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

string b[225816];
set<string> st;

int main(void){
	int n,i;
	string a;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> a >> b[i];
		st.insert(a);
	}
	for(i=0; i<n; ++i){
		if(st.find(b[i])==st.end()){
			cout << b[i] << endl;
			st.insert(b[i]);
		}
	}
	return 0;
}
0