結果

問題 No.1366 交換門松列・梅
ユーザー convexineq
提出日時 2021-01-30 08:17:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 377 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 53,680 KB
最終ジャッジ日時 2025-06-20 10:57:59
合計ジャッジ時間 1,380 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

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

*a, = map(int,input().split())
*b, = map(int,input().split())
ok = 0
for i in range(3):
    for j in range(3):
        a[i],b[j] = b[j],a[i]
        ok |= is_kadomatsu(*a) and is_kadomatsu(*b)
        a[i],b[j] = b[j],a[i]
print("Yes" if ok else "No")
0