結果

問題 No.1366 交換門松列・梅
ユーザー yuruhiyayuruhiya
提出日時 2021-01-29 21:46:25
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 235 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 15,304 KB
最終ジャッジ日時 2023-09-09 15:09:09
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,004 KB
testcase_01 AC 78 ms
15,220 KB
testcase_02 AC 78 ms
15,056 KB
testcase_03 AC 76 ms
15,244 KB
testcase_04 AC 77 ms
15,096 KB
testcase_05 AC 77 ms
15,004 KB
testcase_06 AC 78 ms
14,992 KB
testcase_07 AC 77 ms
15,208 KB
testcase_08 AC 78 ms
15,248 KB
testcase_09 AC 77 ms
15,168 KB
testcase_10 AC 80 ms
15,120 KB
testcase_11 WA -
testcase_12 AC 77 ms
15,184 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 (0...8).to_a.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