結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー ryoo14ryoo14
提出日時 2016-11-27 20:58:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 15,260 KB
最終ジャッジ日時 2023-08-18 08:31:27
合計ジャッジ時間 2,391 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,128 KB
testcase_01 AC 80 ms
15,164 KB
testcase_02 AC 79 ms
15,052 KB
testcase_03 AC 81 ms
15,148 KB
testcase_04 AC 81 ms
15,208 KB
testcase_05 AC 81 ms
15,132 KB
testcase_06 AC 82 ms
15,128 KB
testcase_07 AC 80 ms
15,144 KB
testcase_08 AC 80 ms
15,020 KB
testcase_09 AC 81 ms
15,148 KB
testcase_10 AC 81 ms
15,244 KB
testcase_11 AC 80 ms
15,252 KB
testcase_12 AC 80 ms
15,260 KB
testcase_13 AC 79 ms
15,124 KB
testcase_14 AC 79 ms
15,096 KB
testcase_15 AC 80 ms
15,132 KB
testcase_16 AC 78 ms
15,076 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: character class has duplicated range: /[a-zA-z]/
Syntax OK

ソースコード

diff #

a, b = gets, gets

if a =~ /[a-zA-z]/ || b =~ /[a-zA-Z]/ then
  puts "NG"
elsif a =~ /^0[0-9]+/ || b =~ /^0[0-9]+/ then
  puts "NG"
else
  a = a.to_i
  b = b.to_i
  if a > 12345 || b > 12345 then
    puts "NG"
  else
    puts "OK"
  end
end
0