結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-12-28 19:50:25 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 93 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-12-15 07:58:57 |
合計ジャッジ時間 | 2,566 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
コンパイルメッセージ
Main.rb:4: warning: mismatched indentations at 'rescue' with 'def' at 1 Syntax OK
ソースコード
def isInt?(str)Integer(str)return truerescue ArgumentErrorreturn falseend1.upto(2) do |i|str = STDIN.gets.chompif str.size < 1 || str.size > 5 || (str.size > 1 && str[0] == "0") || !(isInt?(str) && Integer(str) >= 0 && Integer(str) <= 12345)puts "NG"breakendif i == 2puts "OK"endend