結果

問題 No.349 干支の置き物
ユーザー かぼちゃ
提出日時 2018-04-14 15:33:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 684 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 22:13:09
合計ジャッジ時間 1,908 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>

#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define REP(i,a,n) for(int i = (a);i < (n);i++)
#define PI 3.14159265359
#define MOD 1000000007

using namespace std;

int main(){
    int n,max;
    string ans = "YES\n";
    cin >> n;
    max = (n + 1)/2;
    map<string,int> eto =
    { {"ne",0},{"ushi",0},{"tora",0},{"u",0},{"tatsu",0},{"mi",0},{"uma",0},{"hitsuji",0},{"saru",0},{"tori",0},{"inu",0},{"i",0}};
    REP(i, 0, n){
        string s;
        cin >> s;
        eto[s]++;
        if(eto[s] > max)ans = "NO\n";
    }
    cout << ans;
    return 0;
}
0