結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
kyo1
|
| 提出日時 | 2020-09-18 06:15:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 353 bytes |
| コンパイル時間 | 2,091 ms |
| コンパイル使用メモリ | 201,248 KB |
| 最終ジャッジ日時 | 2025-01-14 16:01:03 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
map<string, int> mp;
for (int i = 0; i < N; i++) {
string s;
cin >> s;
mp[s]++;
if (mp[s] > (N + 1) / 2) {
cout << "NO" << '\n';
return 0;
}
}
cout << "YES" << '\n';
return 0;
}
kyo1