結果

問題 No.349 干支の置き物
ユーザー michonz4
提出日時 2019-12-20 19:14:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 77,880 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-16 02:45:15
合計ジャッジ時間 1,813 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;

int main() {
  int n, i, max=0;
  cin >> n;
  map<string, int > mp;

  for (i=0; i<n; i++) {
    string eto;
    cin >> eto;
    mp[eto]++;

    if (mp[eto]>max) max=mp[eto];
  }

  cout << ((n+1)/2>=max ? "YES": "NO") << endl;
}
0