結果
| 問題 | No.349 干支の置き物 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-07 08:38:01 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WJ
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 530 bytes |
| 記録 | |
| 最終ジャッジ日時 | 2026-10-13 13:04:02 |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define coutf(f) cout << fixed << setprecision(f)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
int main() {
int n;
cin >> n;
map<string, int> mp;
rep(i, n) {
string a;
cin >> a;
mp[a]++;
}
for (auto [p, q] : mp) {
if (q > (n + 1) / 2) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
}