結果
問題 | No.24 数当てゲーム |
ユーザー | wotsushi |
提出日時 | 2017-03-02 19:00:01 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 88 ms / 5,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 46 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-06-13 01:33:21 |
合計ジャッジ時間 | 1,470 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i A, B, C, D, R = (1..N).map { a, b, c, d, r = gets.split [*[a, b, c, d].map(&:to_i), r] }.transpose ans = (0..9).find {|n| A.zip(B, C, D, R).all? {|a, b, c, d, r| if r == "YES" [a, b, c, d].include?(n) else not [a, b, c, d].include?(n) end } } puts ans