結果

問題 No.1366 交換門松列・梅
ユーザー HaarHaar
提出日時 2021-01-29 21:26:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 495 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 8,260 KB
最終ジャッジ日時 2023-07-30 08:57:35
合計ジャッジ時間 1,136 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,260 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 16 ms
7,840 KB
testcase_04 AC 16 ms
8,132 KB
testcase_05 AC 16 ms
8,224 KB
testcase_06 AC 16 ms
7,812 KB
testcase_07 AC 16 ms
7,764 KB
testcase_08 AC 15 ms
7,836 KB
testcase_09 AC 15 ms
7,900 KB
testcase_10 AC 16 ms
8,092 KB
testcase_11 AC 15 ms
8,144 KB
testcase_12 AC 16 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_kadomatsu(a, b, c):
    if a != b and b != c and c != a:
        if min(a, b, c) == b or max(a, b, c) == b:
            return True
    return False




a = list(map(int, input().split()))
b = list(map(int, input().split()))


for i in range(3):
    for j in range(3):
        c = a[i]
        a[i] = b[j]
        b[j] = c

        if is_kadomatsu(*a) and is_kadomatsu(*b):
            print("Yes")
            exit(0)

        c = a[i]
        a[i] = b[j]
        b[j] = c

print("No")
0