結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー | hogeki |
提出日時 | 2016-11-18 22:47:28 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 568 bytes |
コンパイル時間 | 2,001 ms |
コンパイル使用メモリ | 103,552 KB |
実行使用メモリ | 17,536 KB |
最終ジャッジ日時 | 2024-11-26 07:28:58 |
合計ジャッジ時間 | 2,176 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; class Ame { static public void Main(string[] args) { string A,B; A = Console.ReadLine(); B = Console.ReadLine(); if(isOK(A) && isOK(B)) Console.WriteLine("OK"); else Console.WriteLine("NG"); } static bool isOK(string s) { for(int i=0; i<s.Length; i++) { if(i==0 && s[i] == '0') { if(s.Length == 1) return true; else return false; } if(s[i] >= '0' && s[i] <= '9') continue; return false; } int x = int.Parse(s); if(x >= 0 && x <= 12345) return true; else return false; } }