結果

問題 No.349 干支の置き物
ユーザー hamrayhamray
提出日時 2017-12-17 11:35:34
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,099 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 63,136 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-21 17:47:42
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 WA -
testcase_27 AC 1 ms
4,380 KB
testcase_28 WA -
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
        
0