結果
問題 | No.349 干支の置き物 |
ユーザー |
|
提出日時 | 2021-11-15 11:36:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 413 bytes |
コンパイル時間 | 2,539 ms |
コンパイル使用メモリ | 200,760 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 10:07:56 |
合計ジャッジ時間 | 4,103 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#define _GLIBCXX_DEBUG #define ll long long #include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(){ int N; cin >> N; map<string, int> mp; for(int i = 0; i < N; i++){ string S; cin >> S; mp[S]++; } if(N%2 != 0) N++; int maxs = 0; for(auto p: mp){ maxs = max(maxs, p.second); } if(maxs <= N/2) cout << "YES" << endl; else cout << "NO" << endl; }