結果

問題 No.938 賢人を探せ
ユーザー ui_mtcui_mtc
提出日時 2020-04-07 05:09:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 527 bytes
コンパイル時間 1,786 ms
コンパイル使用メモリ 177,444 KB
実行使用メモリ 6,412 KB
最終ジャッジ日時 2023-09-21 17:05:00
合計ジャッジ時間 4,209 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
6,412 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 16 ms
4,856 KB
testcase_09 AC 17 ms
4,824 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 21 ms
5,052 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 44 ms
6,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = 1000000007;

signed main() {
  int N;
  cin >> N;
  
  set<string> A;
  vector<string> B(N);
  for( int i = 0; i < N; i++ ){
    string a;
    cin >> a >> B.at(i);
    A.insert(a);
  }
  
  vector<string> ans;
  for( int i = 0; i < N; i++ ){
    if( A.count(B.at(i)) ) continue;
    else ans.push_back(B.at(i));
  }
  
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  for( int i = 0; i < ans.size(); i++ ) cout << ans.at(i) << endl;
}
0