結果
問題 | No.349 干支の置き物 |
ユーザー |
|
提出日時 | 2016-10-31 02:28:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 560 ms |
コンパイル使用メモリ | 65,416 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 23:53:51 |
合計ジャッジ時間 | 1,551 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include<string> using namespace std; int main() { string s; int n,a[12]={}; cin>>n;for(int i=0;i<n;i++) { cin>>s; if(s=="ne")a[0]++; else if(s=="ushi")a[1]++; else if(s=="tora")a[2]++; else if(s=="u")a[3]++; else if(s=="tatsu")a[4]++; else if(s=="mi")a[5]++; else if(s=="uma")a[6]++; else if(s=="hitsuji")a[7]++; else if(s=="saru")a[8]++; else if(s=="tori")a[9]++; else if(s=="inu")a[10]++; else a[11]++; } int max=0; for(int i=0;i<12;i++)max=max<a[i]?a[i]:max; printf("%s",max>++n/2?"NO":"YES"); return 0; }