結果
問題 | No.884 Eat and Add |
ユーザー | tails |
提出日時 | 2019-09-13 23:07:33 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 135 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 29,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 10:22:00 |
合計ジャッジ時間 | 830 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | 3 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 2 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 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | n;r;c; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:2:3: warning: data definition has no type or storage class 2 | n;r;c; | ^ main.c:2:3: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:2:5: warning: data definition has no type or storage class 2 | n;r;c; | ^ main.c:2:5: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] 3 | main(){ | ^~~~ main.c: In function 'main': main.c:4:9: warning: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 4 | gets(s); | ^~~~ main.c:5:15: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 5 | for(n=strlen(s);n--;){ | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen' +++ |+#include <string.h> 1 | char s[201010]; main.c:5:15: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch] 5 | for(n=strlen(s);n--;){ | ^~~~~~ main.c:5:15: note: include '<string.h>' or provide a declaration of 'strlen' main.c:11:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 11 | printf("%d",r+c); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | char s[201010]; main.c:11:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 11 | printf("%d",r+c); | ^~~~~~ main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'printf' /usr/bin/ld: /tmp/ccq4TgzL.o: in function `main': main.c:(.text.startup+0x11): 警告: the `gets' function is dange
ソースコード
char s[201010]; n;r;c; main(){ gets(s); for(n=strlen(s);n--;){ if(s[n]%2!=c){ ++r; c=n&&s[n-1]&1; } } printf("%d",r+c); }