結果

問題 No.1366 交換門松列・梅
ユーザー 👑 horiesinitihoriesiniti
提出日時 2022-12-27 23:09:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 301 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 11,536 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-14 13:04:18
合計ジャッジ時間 2,332 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,048 KB
testcase_01 AC 81 ms
15,104 KB
testcase_02 AC 81 ms
15,120 KB
testcase_03 AC 81 ms
15,164 KB
testcase_04 AC 81 ms
15,168 KB
testcase_05 AC 80 ms
15,088 KB
testcase_06 AC 79 ms
15,284 KB
testcase_07 AC 79 ms
15,044 KB
testcase_08 AC 79 ms
15,160 KB
testcase_09 AC 79 ms
15,340 KB
testcase_10 AC 79 ms
15,232 KB
testcase_11 AC 80 ms
15,092 KB
testcase_12 AC 80 ms
15,056 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|
	3.times{|j|
		a[i],b[j]=b[j],a[i]
		ans=ans||(f(a)&&f(b))
		a[i],b[j]=b[j],a[i]
	}
}
puts (ans)?"Yes":"No"
0