結果

問題 No.349 干支の置き物
ユーザー suibaka_ku
提出日時 2017-03-03 10:26:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 76,848 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 04:41:47
合計ジャッジ時間 1,755 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N; cin >> N;
    int ma = 0;
    map<string, int> m;
    for(int i=0; i<N; ++i) {
        string a; cin >> a;
        ma = max(ma, ++m[a]);
    }
    if(ma > (N+1) / 2) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}
0