結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー basie23
提出日時 2016-12-11 16:24:53
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2024-11-29 03:33:46
合計ジャッジ時間 2,452 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.chomp
b = gets.chomp

def check_has_str(str)
  str.each_char do |c|
    if c !~ /\d+/
      puts 'NG'
      exit
    end
  end
end

def check_zero_digit(str)
  if str.length < 2
    return
  end

  str.each_char do |c|
    if c == '0'
      puts 'NG'
      exit
    else
      return
    end
  end
end

def check_over_12345(int)
  if int > 12345
    puts 'MG'
    exit
  end
end

check_has_str(a)
check_has_str(b)
check_zero_digit(a)
check_zero_digit(b)
check_over_12345(a.to_i)
check_over_12345(b.to_i)

puts 'OK'
0