結果
問題 | No.349 干支の置き物 |
ユーザー |
![]() |
提出日時 | 2017-09-26 20:57:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 644 ms |
コンパイル使用メモリ | 78,496 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 16:52:54 |
合計ジャッジ時間 | 1,654 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> typedef long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(3); std::vector< std::string > eto = {"ne", "ushi", "tora", "u", "tatsu", "mi", "uma", "hitsuji", "saru", "tori", "inu", "i"}; int n; std::cin >> n; std::vector< int > cnt(12, 0); for (int i = 0; i < n; ++i) { std::string s; std::cin >> s; for (int j = 0; j < 12; ++j) { if (s == eto[j]) cnt[j]++; } } for (int j = 0; j < 12; ++j) { if (cnt[j]*2-1 > n) {std::cout << "NO" << std::endl; return 0;} } std::cout << "YES" << std::endl; return 0; }