結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             rapurasu
                         | 
                    
| 提出日時 | 2017-03-10 16:43:58 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 443 bytes | 
| コンパイル時間 | 1,423 ms | 
| コンパイル使用メモリ | 168,768 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-24 07:52:48 | 
| 合計ジャッジ時間 | 2,442 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
 #include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long LL;
int N;
map<string,int>m;
int main(){
    cin>>N;
    REP(i,N){
        string s;
        cin>>s;
        m[s]++;
    }
    for(auto it=m.begin();it!=m.end();it++){
        if((N+1)/2<it->second){
           cout<<"NO"<<endl;
           return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}
            
            
            
        
            
rapurasu