結果
問題 | No.349 干支の置き物 |
ユーザー | umaumax |
提出日時 | 2017-05-01 22:17:33 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 345 bytes |
コンパイル時間 | 675 ms |
コンパイル使用メモリ | 70,432 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 02:14:41 |
合計ジャッジ時間 | 1,684 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include <map> using namespace std; int main(int argc, const char* argv[]) { int N; cin >> N; string As[N]; for (auto&& a : As) cin >> a; map<string, int> m; for (auto&& a : As) m[a]++; for (auto&& v : m) if (v.second > (N + 1) / 2) { cout << "NO" << endl; return 0; } cout << "YES" << endl; return 0; }