結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー | tj_0612 |
提出日時 | 2016-11-18 22:48:34 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 911 bytes |
コンパイル時間 | 716 ms |
コンパイル使用メモリ | 24,648 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-08-17 11:17:13 |
合計ジャッジ時間 | 986 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 0 ms
4,380 KB |
testcase_05 | AC | 0 ms
4,380 KB |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | WA | - |
testcase_08 | AC | 0 ms
4,380 KB |
testcase_09 | WA | - |
testcase_10 | AC | 0 ms
4,376 KB |
testcase_11 | AC | 1 ms
4,380 KB |
testcase_12 | AC | 0 ms
4,380 KB |
testcase_13 | WA | - |
testcase_14 | AC | 0 ms
4,380 KB |
testcase_15 | AC | 1 ms
4,376 KB |
testcase_16 | AC | 1 ms
4,376 KB |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char A[5],B[5]; scanf("%s",A); scanf("%s",B); int a,b,aflag,bflag; int alen,blen; alen = strlen(A); blen = strlen(B); int i; for(i=0;i<alen;i++){ a=A[i]-'0'; if(a<0||a>9){ printf("NG\n"); return 0; break; } if(i!=0){ if(a!=0){ if(aflag==0){ printf("NG\n"); return 0; break; } aflag=1; } else if(aflag==0){ printf("NG\n"); return 0; break; } } } for(i=0;i<blen;i++){ b=B[i]-'0'; if(b<0||b>9){ printf("NG\n"); return 0; break; } if(i!=0){ if(b!=0){ if(bflag==0){ printf("NG\n"); return 0; break; } bflag=1; } else if(bflag==0){ printf("NG\n"); return 0; break; } } } a = atoi(A); b = atoi(B); if(a>12345||b>12345){ printf("NG\n"); return 0; } printf("OK\n"); return 0; }