結果
問題 | No.345 最小チワワ問題 |
ユーザー | 👑 testestest |
提出日時 | 2016-02-26 22:52:41 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 163 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 19,840 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 22:27:03 |
合計ジャッジ時間 | 1,805 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 0 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 1 ms
6,944 KB |
testcase_08 | AC | 0 ms
6,944 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 0 ms
6,940 KB |
testcase_11 | AC | 0 ms
6,944 KB |
testcase_12 | AC | 0 ms
6,944 KB |
testcase_13 | AC | 0 ms
6,940 KB |
testcase_14 | WA | - |
testcase_15 | AC | 1 ms
6,944 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 1 ms
6,940 KB |
testcase_20 | AC | 1 ms
6,944 KB |
testcase_21 | AC | 1 ms
6,944 KB |
testcase_22 | AC | 0 ms
6,940 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 1 ms
6,940 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 0 ms
6,944 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | i,j,m,t; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 2 | i,j,m,t; | ^ main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int] 2 | i,j,m,t; | ^ main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘t’ [-Wimplicit-int] 2 | i,j,m,t; | ^ main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | main(){ | ^~~~ main.c: In function ‘main’: main.c:4:1: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 4 | gets(s); | ^~~~ main.c:6:4: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 6 | i=!printf("%d",m-1); | ^~~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ +++ |+#include <stdio.h> 1 | char s[110]; main.c:6:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] 6 | i=!printf("%d",m-1); | ^~~~~~ main.c:6:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ /usr/bin/ld: /tmp/ccmA3jAn.o: in function `main': main.c:(.text.startup+0x17): 警告: the `gets' function is dangerous and should not be used.
ソースコード
char s[110]; i,j,m,t; main(){ gets(s); for(i=0;s[i];t==2?!m?m=j-i+2:m<j-i?m=j-i+2:0:0,i++)for(t=0,j=i;s[i]=='c'&&t!=2&&s[++j];t+=s[j]=='w'); i=!printf("%d",m-1); }