Contest Duration: - (local time) (100 minutes) Back to Home

Submission #10143486

Source Code Expand

Copy
```#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main() {
int N;
cin >> N;
vector<string> S(N);
REP(i,N) cin >> S[i];
set<string> se(ALL(S));
vector<string> once_S(ALL(se));
vector<long int> once_S_count(once_S.size(),0);

// find max
long int maxi = 0;
REP(i,once_S.size()) {
once_S_count[i] = count(ALL(S),once_S[i]);
chmax(maxi,once_S_count[i]);
}

vector<string> ans;
// get ans
REP(i,once_S.size()) {
if(once_S_count[i]== maxi) {
ans.push_back(once_S[i]);
}
}

sort(ALL(ans));
REP(i,ans.size()) {
cout << ans[i] << endl;
}

return 0;
}
```

#### Submission Info

Submission Time 2020-02-16 21:16:54+0900 C - Poll reud C++14 (GCC 5.4.1) 0 1234 Byte TLE 2105 ms 27148 KB

#### Judge Result

Score / Max Score 0 / 0 0 / 300
Status
 AC × 4
 AC × 17 TLE × 11
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 TLE 2104 ms 22272 KB
sub1_02.txt TLE 2104 ms 15872 KB
sub1_03.txt TLE 2105 ms 25088 KB
sub1_04.txt TLE 2105 ms 25088 KB
sub1_05.txt AC 418 ms 1536 KB
sub1_06.txt TLE 2104 ms 14720 KB
sub1_07.txt TLE 2104 ms 12800 KB
sub1_08.txt AC 46 ms 5120 KB
sub1_09.txt AC 8 ms 896 KB
sub1_10.txt AC 116 ms 11136 KB
sub1_11.txt TLE 2103 ms 8832 KB
sub1_12.txt AC 999 ms 2432 KB
sub1_13.txt TLE 2103 ms 20864 KB
sub1_14.txt TLE 2104 ms 14592 KB
sub1_15.txt AC 95 ms 7680 KB
sub1_16.txt AC 125 ms 10112 KB
sub1_17.txt AC 132 ms 14208 KB
sub1_18.txt AC 171 ms 13312 KB
sub1_19.txt AC 52 ms 3072 KB
sub1_20.txt AC 341 ms 9472 KB
sub1_21.txt AC 422 ms 12416 KB
sub1_22.txt AC 293 ms 12672 KB
sub1_23.txt TLE 2104 ms 27148 KB
sub1_24.txt TLE 2105 ms 25088 KB