Submission #10142102


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;

int main() {
  ios::ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  int n;
  cin >> n;
  map<string, int> mp;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mx = max(mx, ++mp[s]);
  }
  vector<string> ans;
  for (auto& e : mp) {
    if (e.second == mx) {
      ans.push_back(e.first);
    }
  }
  sort(ans.begin(), ans.end());
  for (auto& e : ans) {
    cout << e << '\n';
  }
}

Submission Info

Submission Time
Task C - Poll
User Ununus
Language C++14 (GCC 5.4.1)
Score 300
Code Size 577 Byte
Status AC
Exec Time 367 ms
Memory 25584 KB

Judge Result

Set Name Sample Subtask1
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sub1_01.txt, sub1_02.txt, sub1_03.txt, sub1_04.txt, sub1_05.txt, sub1_06.txt, sub1_07.txt, sub1_08.txt, sub1_09.txt, sub1_10.txt, sub1_11.txt, sub1_12.txt, sub1_13.txt, sub1_14.txt, sub1_15.txt, sub1_16.txt, sub1_17.txt, sub1_18.txt, sub1_19.txt, sub1_20.txt, sub1_21.txt, sub1_22.txt, sub1_23.txt, sub1_24.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
sample_04.txt AC 1 ms 256 KB
sub1_01.txt AC 305 ms 22768 KB
sub1_02.txt AC 166 ms 14196 KB
sub1_03.txt AC 350 ms 25584 KB
sub1_04.txt AC 367 ms 25584 KB
sub1_05.txt AC 8 ms 1408 KB
sub1_06.txt AC 131 ms 14328 KB
sub1_07.txt AC 112 ms 12536 KB
sub1_08.txt AC 20 ms 256 KB
sub1_09.txt AC 4 ms 256 KB
sub1_10.txt AC 43 ms 256 KB
sub1_11.txt AC 61 ms 2432 KB
sub1_12.txt AC 18 ms 1536 KB
sub1_13.txt AC 197 ms 11900 KB
sub1_14.txt AC 145 ms 3968 KB
sub1_15.txt AC 30 ms 256 KB
sub1_16.txt AC 48 ms 256 KB
sub1_17.txt AC 48 ms 256 KB
sub1_18.txt AC 55 ms 256 KB
sub1_19.txt AC 19 ms 256 KB
sub1_20.txt AC 56 ms 256 KB
sub1_21.txt AC 82 ms 256 KB
sub1_22.txt AC 69 ms 256 KB
sub1_23.txt AC 259 ms 25584 KB
sub1_24.txt AC 264 ms 25584 KB