結果
問題 | No.349 干支の置き物 |
ユーザー | butsurizuki |
提出日時 | 2016-11-30 16:13:40 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 14:00:01 |
合計ジャッジ時間 | 1,089 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 0 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 1 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 0 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 0 ms
5,248 KB |
testcase_15 | AC | 1 ms
5,248 KB |
testcase_16 | AC | 0 ms
5,248 KB |
testcase_17 | AC | 0 ms
5,248 KB |
testcase_18 | AC | 0 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 1 ms
5,248 KB |
testcase_22 | AC | 0 ms
5,248 KB |
testcase_23 | AC | 1 ms
5,248 KB |
testcase_24 | AC | 0 ms
5,248 KB |
testcase_25 | AC | 1 ms
5,248 KB |
testcase_26 | AC | 0 ms
5,248 KB |
testcase_27 | AC | 1 ms
5,248 KB |
testcase_28 | AC | 1 ms
5,248 KB |
testcase_29 | AC | 1 ms
5,248 KB |
testcase_30 | AC | 1 ms
5,248 KB |
testcase_31 | AC | 0 ms
5,248 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 7 | scanf("%d",&n); | ^~~~~ main.c:2:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ 1 | #include <string.h> +++ |+#include <stdio.h> 2 | main.c:7:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 7 | scanf("%d",&n); | ^~~~~ main.c:7:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:18:30: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 18 | if(c[i] > n){printf("NO\n");return 0;} | ^~~~~~ main.c:18:30: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:18:30: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:18:30: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:20:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] 20 | printf("YES\n"); | ^~~~~~ main.c:20:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
#include <string.h> int main(void) { char *s[16] = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"}; char t[16]; int c[16] = {0},n,i,j,k; scanf("%d",&n); for(i = 1;i <= n;i++){ scanf("%s",t); for(j = 0;j <= 11;j++){ k = strcmp(t,s[j]); if(!k){c[j]++;} } } if(n%2){n = (n/2)+1;} else{n = n/2;} for(i = 0;i <= 11;i++){ if(c[i] > n){printf("NO\n");return 0;} } printf("YES\n"); return 0; }