結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2016-03-11 22:33:35 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 699 ms |
コンパイル使用メモリ | 69,428 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 00:58:46 |
合計ジャッジ時間 | 1,534 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 2 |
ソースコード
#include <iostream> #include <map> using namespace std; int main(){ int n; cin >> n; map<string,int> m; for(int i = 0;i < n;i++){ string s; cin >> s; m[s]++; } if(m.size() == 2){ cout << "YES" << endl; return 0; } for(auto itr = m.begin();itr != m.end();itr++){ if(itr->second > (n + 1) / 2){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; }