結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hogeover30
                         | 
                    
| 提出日時 | 2016-05-18 23:05:22 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 307 bytes | 
| コンパイル時間 | 1,134 ms | 
| コンパイル使用メモリ | 76,908 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-17 07:33:22 | 
| 合計ジャッジ時間 | 1,927 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
    int n; cin>>n;
    map<string, int> cnt;
    bool ok=true;
    for(int i=0; i<n; ++i) {
        string t; cin>>t;
        ++cnt[t];
        if (cnt[t]>(n+1)/2) ok=false;
    }
    cout<<(ok ? "YES" : "NO")<<endl;
}
            
            
            
        
            
hogeover30