結果
| 問題 | No.349 干支の置き物 |
| コンテスト | |
| ユーザー |
Yut176
|
| 提出日時 | 2016-10-08 20:31:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 655 bytes |
| 記録 | |
| コンパイル時間 | 819 ms |
| コンパイル使用メモリ | 76,704 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 20:37:57 |
| 合計ジャッジ時間 | 1,589 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;
int main(){
int n;
cin >> n;
string a[12] = {"ne", "ushi", "tora", "u", "tatsu", "mi", "uma", "hitsuji", "saru", "tori", "inu", "i"};
vector<int> eto(12);
for(int i=0; i<n; i++){
string tmp;
cin >> tmp;
for(int j=0; j<12; j++) if( tmp == a[j] ) eto[j]++;
}
if( *max_element(eto.begin(), eto.end())*2 - 1 <= accumulate(eto.begin(), eto.end(), 0) ) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
Yut176