結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2018-09-21 14:53:17 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 854 bytes |
コンパイル時間 | 326 ms |
コンパイル使用メモリ | 30,976 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 08:40:45 |
合計ジャッジ時間 | 1,067 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void){ int N; char A[50][8]; char eto[12][8] = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"}; int count[12] = {0}; int max = 0; // check ok // printf("%s\n",eto[10]); scanf("%d",&N); // count // compare for(int i = 0; i < N; i++){ scanf("%s",A[i]); for(int j = 0; j < 12; j++){ if( strcmp(A[i],eto[j]) == 0 ){ count[j]++; break; } } } for(int k = 0; k < 12; k++){ if(max < count[k]){ max = count[k]; } } if(N % 2 != 0){ N = N / 2 + 1; }else{ N = N / 2; } if(max > N){ printf("NO\n"); }else{ printf("YES\n"); } return 0; }