結果
問題 | No.360 増加門松列 |
ユーザー | %20 |
提出日時 | 2017-07-15 14:56:43 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 252 bytes |
コンパイル時間 | 1,015 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-06 12:50:59 |
合計ジャッジ時間 | 1,762 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | D; | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 'D' [-Wimplicit-int] main.c:2:1: warning: data definition has no type or storage class 2 | x[101]; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | f=0,g=0; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] main.c:3:5: warning: type defaults to 'int' in declaration of 'g' [-Wimplicit-int] 3 | f=0,g=0; | ^ main.c:4:1: warning: data definition has no type or storage class 4 | c=0;max; | ^ main.c:4:1: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:4:5: warning: data definition has no type or storage class 4 | c=0;max; | ^~~ main.c:4:5: warning: type defaults to 'int' in declaration of 'max' [-Wimplicit-int] main.c:5:1: warning: return type defaults to 'int' [-Wimplicit-int] 5 | main(i){ | ^~~~ main.c: In function 'main': main.c:5:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:6:15: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | for(;~scanf("%d",&D);)++x[D]; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | D; main.c:6:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | for(;~scanf("%d",&D);)++x[D]; | ^~~~~ main.c:6:15: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:15:9: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 15 | puts(f?"NO":"YES"); | ^~~~ main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'puts'
ソースコード
D; x[101]; f=0,g=0; c=0;max; main(i){ for(;~scanf("%d",&D);)++x[D]; for(i=1;i<=100;++i){ if(x[i]){++c;max=i;} if(x[i]>=3)f=1; if(c==1&&x[i]==2)f=1; if(c==2&&x[i]==2)g=1; if(g&&c==4&&x[i]==2)f=1; } if(x[max]==2)f=1; puts(f?"NO":"YES"); }