結果

問題 No.938 賢人を探せ
ユーザー occhanocchan
提出日時 2019-12-01 01:42:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 171,752 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2023-08-21 03:28:24
合計ジャッジ時間 3,130 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
7,844 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 17 ms
5,680 KB
testcase_09 AC 17 ms
5,364 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 22 ms
6,084 KB
testcase_12 AC 19 ms
5,536 KB
testcase_13 AC 20 ms
5,368 KB
testcase_14 AC 20 ms
5,508 KB
testcase_15 AC 20 ms
5,368 KB
testcase_16 AC 20 ms
5,532 KB
testcase_17 AC 20 ms
5,368 KB
testcase_18 AC 19 ms
5,536 KB
testcase_19 AC 20 ms
5,560 KB
testcase_20 AC 20 ms
5,408 KB
testcase_21 AC 20 ms
5,548 KB
testcase_22 AC 53 ms
7,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef 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]);
    }
  }
}
0