結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー tanukidontanukidon
提出日時 2018-04-30 13:11:12
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 438 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 11,376 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-09-10 08:24:46
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = a.chomp.split("")
b = b.chomp.split("")
c = 0
if a[0] == "0" && a.size != 1
  c = 1
else
  a.each_index do |i|
    if a[i] =~ /\D/
      c = 1
      break
    end
  end
end
if c == 1
elsif b[0] == "0" && b.size != 1
  c = 1
else
  b.each_index do |i|
    if b[i] =~ /\D/
      c = 1
      break
    end
  end
end
if c == 0
  if a.join.to_i <= 12345 && b.join.to_i <= 12345
    puts "OK"
  else
    puts "NG"
  end
else
  puts "NG"
end
0