結果
問題 | No.349 干支の置き物 |
ユーザー |
|
提出日時 | 2016-03-11 22:29:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 758 ms |
コンパイル使用メモリ | 68,092 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 07:21:56 |
合計ジャッジ時間 | 1,627 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include <cstdio> #include <string> #include <map> using namespace std; int main() { int n; cin >> n; string s; map<string, int> animal; for (int i = 0; i < n; i++) { cin >> s; animal[s]++; } int maxi = 0; for (auto p : animal) { maxi = max(maxi, p.second); } cout << (maxi <= (n + 1) / 2? "YES" : "NO") << endl; return 0; }