結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー mikoto_kannagimikoto_kannagi
提出日時 2016-12-28 19:50:25
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 15,304 KB
最終ジャッジ日時 2023-08-21 18:19:15
合計ジャッジ時間 2,573 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,260 KB
testcase_01 AC 81 ms
15,056 KB
testcase_02 AC 81 ms
15,112 KB
testcase_03 AC 80 ms
15,228 KB
testcase_04 AC 80 ms
15,160 KB
testcase_05 AC 82 ms
15,232 KB
testcase_06 AC 81 ms
15,120 KB
testcase_07 AC 79 ms
15,156 KB
testcase_08 AC 81 ms
15,236 KB
testcase_09 AC 80 ms
15,084 KB
testcase_10 AC 79 ms
15,128 KB
testcase_11 AC 80 ms
15,060 KB
testcase_12 AC 80 ms
15,228 KB
testcase_13 AC 80 ms
15,240 KB
testcase_14 AC 79 ms
15,152 KB
testcase_15 AC 80 ms
15,284 KB
testcase_16 AC 80 ms
15,304 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: mismatched indentations at 'rescue' with 'def' at 1
Syntax OK

ソースコード

diff #

def isInt?(str)
    Integer(str)
    return true
    rescue ArgumentError
        return false
end

1.upto(2) do |i|
    str = STDIN.gets.chomp
    if str.size < 1 || str.size > 5 || (str.size > 1 && str[0] == "0") || !(isInt?(str) && Integer(str) >= 0 && Integer(str) <= 12345)
        puts "NG"
        break
    end
    if i == 2
        puts "OK"
    end
end
0