結果
| 問題 |
No.706 多眼生物の調査
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-02-09 20:51:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 673 bytes |
| コンパイル時間 | 2,012 ms |
| コンパイル使用メモリ | 82,844 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 02:54:33 |
| 合計ジャッジ時間 | 1,463 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main(){
int n;
cin >> n;
map<string , int> cnt;
for(int i = 0; i < n; i++){
string s;
cin >> s;
cnt[s]++;
}
int mx = -1;
string anss;
for(auto i : cnt){
if(mx < i.second){
mx = i.second;
anss = i.first;
}else if(mx == i.second){
if(anss.size() < i.first.size()){
anss = i.first;
}
}
}
//cout << anss << endl;
int ans = anss.size() - 2;
cout << ans << endl;
return 0;
}
mmn15277198