結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
wanimaru47
|
| 提出日時 | 2016-03-11 23:04:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 599 bytes |
| コンパイル時間 | 1,528 ms |
| コンパイル使用メモリ | 164,624 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 07:23:47 |
| 合計ジャッジ時間 | 2,348 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
auto etoi = [](string s) -> int {
vector<string> ary = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
return (int)(find(ary.begin(), ary.end(), s) - ary.begin());
};
vector<int> v(12);
for (int i = 0; i < N; i++) {
string str; cin >> str;
v[etoi(str)]++;
}
for (auto i : v) {
if (i > (N + 1) / 2) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
}
wanimaru47