結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
harhogefoo
|
| 提出日時 | 2016-11-24 20:34:27 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 2,000 ms |
| コード長 | 523 bytes |
| コンパイル時間 | 250 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-11-27 10:49:15 |
| 合計ジャッジ時間 | 2,751 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
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(num)
if num > 12345
puts 'NG'
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'
harhogefoo