結果
| 問題 | No.938 賢人を探せ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-01 09:03:14 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 505 bytes |
| 記録 | |
| コンパイル時間 | 626 ms |
| コンパイル使用メモリ | 97,640 KB |
| 実行使用メモリ | 8,032 KB |
| 最終ジャッジ日時 | 2026-05-25 05:54:42 |
| 合計ジャッジ時間 | 2,063 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include<iostream>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main(){
set<string> a;
set<string> b;
vector<string> v;
int n;
cin >> n;
for(int i = 0; i < n; i++){
string x, y;
cin >> x >> y;
if(a.count(x)==0&&b.count(x)==0) v.push_back(x);
if(a.count(y)==0&&b.count(y)==0) v.push_back(y);
a.insert(x);
b.insert(y);
}
for(string s : v) if(a.count(s)==0) cout << s << endl;
return 0;
}