結果

問題 No.1366 交換門松列・梅
ユーザー 👑 horiesinitihoriesiniti
提出日時 2022-12-27 23:05:20
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 15,416 KB
最終ジャッジ日時 2023-08-14 13:00:18
合計ジャッジ時間 2,721 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,008 KB
testcase_01 AC 77 ms
15,088 KB
testcase_02 AC 79 ms
15,152 KB
testcase_03 AC 82 ms
15,296 KB
testcase_04 WA -
testcase_05 AC 76 ms
15,288 KB
testcase_06 AC 77 ms
15,260 KB
testcase_07 AC 77 ms
15,148 KB
testcase_08 AC 76 ms
15,064 KB
testcase_09 AC 79 ms
15,088 KB
testcase_10 AC 78 ms
15,132 KB
testcase_11 WA -
testcase_12 AC 77 ms
15,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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"
0