結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー | subsn |
提出日時 | 2023-06-16 16:55:53 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 480 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 29,568 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-24 09:30:48 |
合計ジャッジ時間 | 801 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | main(n1,n2,l1,l2,i) | ^~~~ main.c: In function 'main': main.c:1:1: warning: type of 'n1' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'n2' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'l1' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'l2' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:5:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%s\n%s",s1,s2); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(n1,n2,l1,l2,i) main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%s\n%s",s1,s2); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:8:12: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 8 | l1=strlen(s1); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen' +++ |+#include <string.h> 1 | main(n1,n2,l1,l2,i) main.c:8:12: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch] 8 | l1=strlen(s1); | ^~~~~~ main.c:8:12: note: include '<string.h>' or provide a declaration of 'strlen' main.c:20:21: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration] 20 | if(!isdigit(s1[i])||(s1[0]=='0'&&l1!=1)) { | ^~~~~~~ main.c:1:1: note: include '<ctype.h>' or provide a declaration of 'isdigit' +++ |+#include <ctype.h> 1 | main(n1,n2,l1,l2,i) main.c:29:9: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 29 |
ソースコード
main(n1,n2,l1,l2,i) { char s1[6]; char s2[6]; scanf("%s\n%s",s1,s2); n1=0; n2=0; l1=strlen(s1); l2=strlen(s2); for(int i=0;i<l1;i++){ n1=(n1)*10+(s1[i]-'0'); } for(int i=0;i<l2;i++){ n2=(n2)*10+(s2[i]-'0'); } if(n1>12345||n2>12345){ goto A; } for(i=0;i<l1;i++){ if(!isdigit(s1[i])||(s1[0]=='0'&&l1!=1)) { goto A; } } for(i=0;i<l2;i++){ if(!isdigit(s2[i])||(s2[0]=='0'&&l2!=1)){ goto A; } } puts("OK"); return 0; A: puts("NG"); return 0; }