結果
| 問題 |
No.1366 交換門松列・梅
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2022-12-27 23:05:20 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-11-22 10:30:21 |
| 合計ジャッジ時間 | 2,162 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 2 |
コンパイルメッセージ
Syntax OK
ソースコード
def f(as)
return as.uniq.size==3 && ((as[1]<as[0] && as[1]<as[2]) || (as[1]>as[0] && as[1]>as[2]))
end
a=gets.split(" ").map{|e| e.to_i}
b=gets.split(" ").map{|e| e.to_i}
ans=false
3.times{|i|
a[i],b[i]=b[i],a[i]
ans=ans||(f(a)&&f(b))
a[i],b[i]=b[i],a[i]
}
puts (ans)?"Yes":"No"
horiesiniti