結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                            👑  | 
                    
| 提出日時 | 2020-01-22 07:00:22 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 373 bytes | 
| コンパイル時間 | 644 ms | 
| コンパイル使用メモリ | 78,684 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-07 05:13:41 | 
| 合計ジャッジ時間 | 1,757 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
#include <iostream>
#include <map>
using namespace std;
int main(){
    int n;cin>>n;
    map<string,int> A;
    for(int i = 0; n > i; i++){
        string s;cin>>s;
        A[s]++;
    }
    for(auto x:A){
        if(x.second >= (n+3)/2){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
}
//3 3 6
//4 3 7
//5 4 8
//6 4 9