Advertisement
MohamedAbdel3al

B. Find The Imposter 2

Sep 15th, 2021 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std ;
  4. #define sz(s) int(s.size())
  5. typedef long long ll ;
  6. #define all(v) v.begin() , v.end()
  7.  
  8. void ABDEL3AL () {
  9. ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
  10. #ifndef ONLINE_JUDGE
  11. freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
  12. #endif
  13. }
  14.  
  15. int main() {
  16. ABDEL3AL() ;
  17. int n ; cin >> n ;
  18. map<string, int> mp;
  19. while (n--) {
  20. for (auto &i: mp) {
  21. string col;
  22. cin >> col, mp[col]++;
  23. string room;
  24. cin >> room;
  25. int k;
  26. cin >> k;
  27. while (k--) cin >> col, mp[col]++;
  28. }
  29. }
  30. string imp ;
  31. int Min = INT_MAX ;
  32. for (auto& i : mp)
  33. if (i.second < Min) Min = i.second , imp = i.first ;
  34. cout << imp ;
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement