結果

問題 No.938 賢人を探せ
ユーザー chocoruskchocorusk
提出日時 2019-12-01 00:04:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 804 bytes
コンパイル時間 1,139 ms
コンパイル使用メモリ 117,132 KB
実行使用メモリ 9,328 KB
最終ジャッジ日時 2023-08-21 03:24:24
合計ジャッジ時間 2,637 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
9,328 KB
testcase_01 AC 3 ms
4,584 KB
testcase_02 AC 3 ms
4,612 KB
testcase_03 AC 2 ms
4,612 KB
testcase_04 AC 3 ms
4,792 KB
testcase_05 AC 3 ms
4,580 KB
testcase_06 AC 3 ms
4,636 KB
testcase_07 AC 2 ms
4,584 KB
testcase_08 AC 17 ms
5,904 KB
testcase_09 AC 18 ms
6,036 KB
testcase_10 AC 3 ms
4,640 KB
testcase_11 AC 22 ms
6,216 KB
testcase_12 AC 20 ms
6,072 KB
testcase_13 AC 21 ms
6,124 KB
testcase_14 AC 21 ms
6,100 KB
testcase_15 AC 21 ms
6,064 KB
testcase_16 AC 21 ms
6,340 KB
testcase_17 AC 21 ms
6,116 KB
testcase_18 AC 20 ms
6,316 KB
testcase_19 AC 21 ms
6,204 KB
testcase_20 AC 20 ms
6,100 KB
testcase_21 AC 20 ms
6,232 KB
testcase_22 AC 60 ms
9,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
    int n;
	cin>>n;
	string a[20020], b[20020];
	map<string, int> mp, mp2;
	for(int i=0; i<n; i++){
		cin>>a[i]>>b[i];
		mp[a[i]]++;
	}
	for(int i=0; i<n; i++){
		if(mp[b[i]]==0 && mp2[b[i]]==0){
			cout<<b[i]<<endl;
			mp2[b[i]]++;
		}
	}
	return 0;
}
0