結果

問題 No.938 賢人を探せ
ユーザー ransewhaleransewhale
提出日時 2019-12-08 06:41:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 1,919 ms
コンパイル使用メモリ 171,092 KB
実行使用メモリ 13,564 KB
最終ジャッジ日時 2023-08-21 03:36:17
合計ジャッジ時間 3,396 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
13,496 KB
testcase_01 AC 6 ms
10,432 KB
testcase_02 AC 6 ms
10,432 KB
testcase_03 AC 6 ms
10,428 KB
testcase_04 AC 5 ms
10,468 KB
testcase_05 AC 5 ms
10,476 KB
testcase_06 AC 6 ms
10,432 KB
testcase_07 AC 5 ms
10,424 KB
testcase_08 AC 20 ms
11,736 KB
testcase_09 AC 20 ms
11,900 KB
testcase_10 AC 6 ms
10,360 KB
testcase_11 AC 25 ms
12,036 KB
testcase_12 AC 23 ms
11,980 KB
testcase_13 AC 22 ms
11,816 KB
testcase_14 AC 22 ms
11,824 KB
testcase_15 AC 23 ms
11,804 KB
testcase_16 AC 23 ms
11,800 KB
testcase_17 AC 22 ms
11,956 KB
testcase_18 AC 22 ms
11,812 KB
testcase_19 AC 22 ms
11,800 KB
testcase_20 AC 23 ms
11,796 KB
testcase_21 AC 23 ms
11,984 KB
testcase_22 AC 55 ms
13,564 KB
権限があれば一括ダウンロードができます

ソースコード

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