結果
| 問題 | No.1366 交換門松列・梅 |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2022-12-27 23:05:20 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| 記録 | |
| コンパイル時間 | 198 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-05-16 12:54:44 |
| 合計ジャッジ時間 | 2,142 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 3 |
コンパイルメッセージ
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