結果

問題 No.1366 交換門松列・梅
ユーザー cologne
提出日時 2023-07-12 16:49:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 1,000 ms
コード長 435 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-06-20 11:13:22
合計ジャッジ時間 1,069 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    def imm(a, b, c):
        return a != b != c != a and (a > b < c or a < b > c)

    *A, = map(int, input().split())
    *B, = map(int, input().split())
    for i in range(3):
        for j in range(3):
            A[i], B[j] = B[j], A[i]
            if imm(*A) and imm(*B):
                print('Yes')
                return
            A[i], B[j] = B[j], A[i]

    print('No')


if __name__ == '__main__':
    main()
0