結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,028 KB
testcase_01 AC 80 ms
15,164 KB
testcase_02 AC 78 ms
15,164 KB
testcase_03 WA -
testcase_04 AC 79 ms
15,208 KB
testcase_05 AC 79 ms
15,272 KB
testcase_06 AC 80 ms
15,020 KB
testcase_07 AC 78 ms
15,324 KB
testcase_08 AC 77 ms
15,256 KB
testcase_09 AC 77 ms
15,144 KB
testcase_10 AC 80 ms
15,152 KB
testcase_11 AC 81 ms
15,172 KB
testcase_12 WA -
testcase_13 AC 77 ms
15,084 KB
testcase_14 AC 77 ms
15,172 KB
testcase_15 AC 80 ms
15,048 KB
testcase_16 AC 80 ms
15,260 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.chomp.split("")
b = gets.chomp.split("")
c = 0
if a[0] == "0"
  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"
  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