結果

問題 No.1366 交換門松列・梅
ユーザー donutholedonuthole
提出日時 2021-01-29 21:35:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 1,000 ms
コード長 937 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 71,800 KB
最終ジャッジ日時 2023-07-30 08:59:33
合計ジャッジ時間 2,455 ms
ジャッジサーバーID
(参考情報)
judge5 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,368 KB
testcase_01 AC 92 ms
71,604 KB
testcase_02 AC 93 ms
71,688 KB
testcase_03 AC 94 ms
71,800 KB
testcase_04 AC 95 ms
71,508 KB
testcase_05 AC 95 ms
71,744 KB
testcase_06 AC 97 ms
71,768 KB
testcase_07 AC 95 ms
71,576 KB
testcase_08 AC 95 ms
71,640 KB
testcase_09 AC 97 ms
71,696 KB
testcase_10 AC 98 ms
71,640 KB
testcase_11 AC 97 ms
71,636 KB
testcase_12 AC 96 ms
71,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
import collections
import bisect


# sys.setrecursionlimit(10000001)
INF = 10 ** 20
# MOD = 10 ** 9 + 7
MOD = 998244353


def ni(): return int(sys.stdin.buffer.readline())
def ns(): return map(int, sys.stdin.buffer.readline().split())
def na(): return list(map(int, sys.stdin.buffer.readline().split()))
def na1(): return list(map(lambda x: int(x)-1, sys.stdin.buffer.readline().split()))


# ===CODE===

def main():
    a = na()
    b = na()

    for i in range(3):
        for j in range(3):
            ta = a.copy()
            tb = b.copy()
            ta[i], tb[j] = tb[j], ta[i]

            f1 = ta[0] < ta[1] > ta[2] or ta[0] > ta[1] < ta[2]
            f2 = tb[0] < tb[1] > tb[2] or tb[0] > tb[1] < tb[2]
            f3 = len(set(ta)) == 3 and len(set(tb)) == 3
            if f1 and f2 and f3:
                print("Yes")
                return

    print("No")


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