結果

問題 No.1366 交換門松列・梅
ユーザー yuruhiyayuruhiya
提出日時 2021-01-29 21:47:42
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,436 KB
実行使用メモリ 15,276 KB
最終ジャッジ日時 2023-09-09 15:10:26
合計ジャッジ時間 1,907 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,112 KB
testcase_01 AC 80 ms
15,276 KB
testcase_02 AC 76 ms
15,140 KB
testcase_03 AC 80 ms
15,228 KB
testcase_04 WA -
testcase_05 AC 73 ms
15,052 KB
testcase_06 AC 75 ms
15,052 KB
testcase_07 AC 75 ms
15,228 KB
testcase_08 AC 81 ms
15,092 KB
testcase_09 AC 80 ms
15,136 KB
testcase_10 AC 73 ms
15,128 KB
testcase_11 WA -
testcase_12 AC 76 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def c(a)
    a.uniq.size==3 && (a.max==a[1] || a.min==a[1])
end

a,b=$<.map{_1.split.map &:to_i}
puts [1,2,4].any?{|j|
    x,y=a.dup,b.dup
    3.times{
        x[_1],y[_1]=y[_1],x[_1] if j[_1]==1
    }
    c(x)&&c(y)
}?"Yes":"No" 
0