結果
問題 | No.349 干支の置き物 |
ユーザー | aaaaaaiu |
提出日時 | 2019-07-30 14:46:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 1,882 ms |
コンパイル使用メモリ | 200,188 KB |
最終ジャッジ日時 | 2025-01-07 10:06:15 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; map<string, int> cnt; int mx = 0; for (int i = 0; i < n; i++) { string s; cin >> s; cnt[s]++; mx = max(mx, cnt[s]); } if (mx <= n-mx+1) puts("YES"); else puts("NO"); return 0; }