結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2016-05-01 21:38:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 1,363 ms |
コンパイル使用メモリ | 69,596 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 07:31:26 |
合計ジャッジ時間 | 1,775 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <cstdio> #include <iostream> #include <map> int main(){ int N; std::cin >> N; std::map<std::string, int> map; for(int i=0;i<N;i++){ std::string S; std::cin >> S; ++map[S]; } int mx = 0; for(auto &p : map){ int n; std::tie(std::ignore, n) = p; mx = std::max(mx, n); } if(mx > (N+1) / 2){ puts("NO"); }else{ puts("YES"); } }