結果
| 問題 | No.632 穴埋め門松列 | 
| コンテスト | |
| ユーザー |  siman | 
| 提出日時 | 2020-05-27 01:13:15 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 95 ms / 1,000 ms | 
| コード長 | 374 bytes | 
| コンパイル時間 | 35 ms | 
| コンパイル使用メモリ | 7,552 KB | 
| 実行使用メモリ | 12,288 KB | 
| 最終ジャッジ日時 | 2024-10-13 03:09:20 | 
| 合計ジャッジ時間 | 1,146 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
コンパイルメッセージ
Syntax OK
ソースコード
C1, C2, C3 = gets.chomp.split.map { |c|
  if c == '?'
    -1
  else
    c.to_i
  end
}
def f(nums)
  return true if nums[0] < nums[1] && nums[1] > nums[2]
  return true if nums[0] > nums[1] && nums[1] < nums[2]
  false
end
nums = [C1, C2, C3]
idx = nums.index(-1)
ans = ''
nums[idx] = 1
if f(nums)
  ans += '1'
end
nums[idx] = 4
if f(nums)
  ans += '4'
end
puts ans
            
            
            
        