結果
問題 | No.938 賢人を探せ |
ユーザー |
![]() |
提出日時 | 2019-12-01 01:42:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 656 bytes |
コンパイル時間 | 1,968 ms |
コンパイル使用メモリ | 174,852 KB |
実行使用メモリ | 7,552 KB |
最終ジャッジ日時 | 2024-12-14 11:42:18 |
合計ジャッジ時間 | 2,954 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define ll long longtypedef pair<ll,ll> P;template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false; }#define M 1000000007#define all(a) (a).begin(),(a).end()#define rep(i,n) reps(i,0,n)#define reps(i,m,n) for(int i=(m);i<(n);i++)int main(){int n;cin>>n;set<string> st;vector<string> s(n),t(n);rep(i,n){cin>>s[i]>>t[i];st.insert(s[i]);}rep(i,n){if(st.find(t[i])==st.end()){cout<<t[i]<<endl;st.insert(t[i]);}}}