結果

問題 No.632 穴埋め門松列
ユーザー gemmarogemmaro
提出日時 2019-10-19 07:30:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 11,328 KB
実行使用メモリ 15,272 KB
最終ジャッジ日時 2023-09-08 15:57:30
合計ジャッジ時間 1,881 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,272 KB
testcase_01 AC 77 ms
15,252 KB
testcase_02 AC 79 ms
15,256 KB
testcase_03 AC 80 ms
15,024 KB
testcase_04 AC 79 ms
15,128 KB
testcase_05 AC 78 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def is_ok c1, c2, c3, lack
    if c1 == 0 then c1 = lack
    elsif c2 == 0 then c2 = lack
    else c3 = lack
    end
    return false if c1 == c2 or c2 == c3 or c3 == c1
    [c1, c2, c3].max == c2 or [c1, c2, c3].min == c2
end

c1, c2, c3 = gets.chomp.split.map &:to_i
print 1 if is_ok c1, c2, c3, 1
print 4 if is_ok c1, c2, c3, 4
puts
0