結果
問題 | No.349 干支の置き物 |
ユーザー | miku39kk |
提出日時 | 2017-07-23 14:52:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 597 bytes |
コンパイル時間 | 486 ms |
コンパイル使用メモリ | 62,804 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 10:56:56 |
合計ジャッジ時間 | 1,643 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n,n2,a[12] = {}; vector<string> test = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"}; cin >> n; for(int i = 0; i < n;i++){ string s; cin >> s; for(int j = 0;j < 12;j++){ if(s == test[j])a[j]++; } } n2 = n/2; if(n%2 != 0)n2++; string ans = "YES\n"; for(int i = 0;i < 12; i++){ if(a[i] > n2){ ans = "NO\n"; break; } } cout << ans; return 0; }