結果

問題 No.1366 交換門松列・梅
ユーザー ayaoniayaoni
提出日時 2021-01-29 21:30:00
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 864 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 71,332 KB
最終ジャッジ日時 2023-07-30 08:58:51
合計ジャッジ時間 2,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,176 KB
testcase_01 AC 72 ms
70,928 KB
testcase_02 AC 69 ms
71,096 KB
testcase_03 AC 71 ms
71,328 KB
testcase_04 AC 73 ms
71,216 KB
testcase_05 AC 72 ms
71,332 KB
testcase_06 AC 70 ms
70,932 KB
testcase_07 AC 71 ms
71,008 KB
testcase_08 AC 72 ms
71,264 KB
testcase_09 AC 70 ms
71,164 KB
testcase_10 AC 71 ms
71,220 KB
testcase_11 AC 71 ms
71,260 KB
testcase_12 AC 71 ms
70,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


A = LI()
B = LI()


def is_kadomatsu(X):
    if X[0] != X[1] != X[2] != X[0] and (max(X) == X[1] or min(X) == X[1]):
        return True
    return False


for i in range(3):
    for j in range(3):
        X = A[:]
        Y = B[:]
        X[i],Y[j] = Y[j],X[i]
        if is_kadomatsu(X) and is_kadomatsu(Y):
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')
0