結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-12-17 11:35:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,099 bytes |
| コンパイル時間 | 700 ms |
| コンパイル使用メモリ | 63,276 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-15 07:22:13 |
| 合計ジャッジ時間 | 1,520 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 4 |
ソースコード
#include<iostream>
#include<algorithm>
#include<queue>
#include <climits>
#include<string>
using namespace std;
int eto[12]; int N;
string str;
int main(){
cin >> N;
int maxV = 0;
for(int i = 0; i < N; i++){
cin >> str;
if(str == "ne") eto[0]++;
else if(str == "ushi") eto[1]++;
else if(str == "tra") eto[2]++;
else if(str == "u") eto[3]++;
else if(str == "tatsu") eto[4]++;
else if(str == "mi") eto[5]++;
else if(str == "uma") eto[6]++;
else if(str == "hitsuji") eto[7]++;
else if(str == "saru") eto[8]++;
else if(str == "tori") eto[9]++;
else if(str == "inu") eto[10]++;
else if(str == "i") eto[11]++;
}
for(int i = 0; i < 12; i++){
maxV = max(maxV, eto[i]);
}
if(N == 1){
cout << "YES" << endl;
}else if(N == 2 || N == 3){
if(N - 1 >= maxV) cout << "YES" << endl;
else cout << "NO" << endl;
}else if (N >= 4){
if(N - 2 >= maxV) cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
hamray