結果

問題 No.1366 交換門松列・梅
ユーザー rlangevin
提出日時 2025-02-18 08:54:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 443 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 81,932 KB
実行使用メモリ 53,260 KB
最終ジャッジ日時 2025-06-20 11:26:51
合計ジャッジ時間 1,407 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def kadomatsu(X):
    a, b, c = X
    if a == b or b == c or c == a:
        return False
    if a < b < c or a > b > c:
        return False
    return True

A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(3):
    for j in range(3):
        A[i], B[j] = B[j], A[i]
        if kadomatsu(A) and kadomatsu(B):
            print("Yes")
            exit()
        A[i], B[j] = B[j], A[i]
        
print("No")
0