結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-03-17 22:28:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 235 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 15,308 KB
最終ジャッジ日時 2023-08-25 15:45:49
合計ジャッジ時間 2,520 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,216 KB
testcase_01 AC 82 ms
15,168 KB
testcase_02 AC 80 ms
15,064 KB
testcase_03 AC 82 ms
15,104 KB
testcase_04 AC 81 ms
15,204 KB
testcase_05 AC 81 ms
15,260 KB
testcase_06 AC 81 ms
15,244 KB
testcase_07 WA -
testcase_08 AC 81 ms
15,308 KB
testcase_09 AC 80 ms
15,044 KB
testcase_10 AC 82 ms
15,000 KB
testcase_11 AC 80 ms
15,056 KB
testcase_12 AC 81 ms
15,132 KB
testcase_13 AC 80 ms
15,036 KB
testcase_14 AC 82 ms
15,168 KB
testcase_15 AC 82 ms
15,232 KB
testcase_16 AC 82 ms
15,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

A, B = gets.chomp, gets.chomp
MAXIMUM_VALUE = 12_345

if A =~ /[^\d]/ || B =~ /[^\d]/
  puts 'NG'
  exit
end

if A =~ /^0+[^0]+/ || B =~ /^0+[^0]+/ ||
   [A.to_i, B.to_i].find { |n| n > MAXIMUM_VALUE }
  puts 'NG'
  exit
end

puts 'OK'
0