結果
問題 |
No.632 穴埋め門松列
|
ユーザー |
|
提出日時 | 2019-10-19 07:12:23 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 96 ms / 1,000 ms |
コード長 | 735 bytes |
コンパイル時間 | 203 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-06-26 08:45:23 |
合計ジャッジ時間 | 1,454 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
def is_ok_1 c1, c2, c3 if c1 == 0 c1 = 1 elsif c2 == 0 c2 = 1 else c3 = 1 end if c1 == c2 or c2 == c3 or c3 == c1 return false end if [c1, c2, c3].max == c2 or [c1, c2, c3].min == c2 return true else return false end end def is_ok_4 c1, c2, c3 if c1 == 0 c1 = 4 elsif c2 == 0 c2 = 4 else c3 = 4 end if c1 == c2 or c2 == c3 or c3 == c1 return false end if [c1, c2, c3].max == c2 or [c1, c2, c3].min == c2 return true else return false end end c1, c2, c3 = gets.chomp.split.map &:to_i if is_ok_1(c1, c2, c3) print 1 end if is_ok_4(c1, c2, c3) print 4 end puts