結果

問題 No.1366 交換門松列・梅
ユーザー Fullmoon85072Fullmoon85072
提出日時 2021-11-15 21:51:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 768 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 53,632 KB
最終ジャッジ日時 2024-04-17 10:37:04
合計ジャッジ時間 1,395 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
52,864 KB
testcase_01 AC 46 ms
53,248 KB
testcase_02 AC 46 ms
53,632 KB
testcase_03 AC 45 ms
52,864 KB
testcase_04 AC 46 ms
53,376 KB
testcase_05 AC 46 ms
53,248 KB
testcase_06 AC 45 ms
53,120 KB
testcase_07 AC 46 ms
53,376 KB
testcase_08 AC 46 ms
53,120 KB
testcase_09 AC 46 ms
53,248 KB
testcase_10 AC 46 ms
52,992 KB
testcase_11 AC 46 ms
53,504 KB
testcase_12 AC 46 ms
53,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import copy

input_list = list()
for i in range(2):
    row_list = list()
    line = input().split(" ")
    for x in line:
        row_list.append(int(x))
    input_list.append(row_list)

x = 0
y = 0
for count in range(9):
    # work
    a = copy.copy(input_list[0])
    b = copy.copy(input_list[1])

    # exchange
    change_a = a[x]
    change_b = b[y]
    a[x] = change_b
    b[y] = change_a
    # print(a)
    # print(b)
    # print()

    # judge
    if len(a) == len(set(a)) and len(b) == len(set(b)):
        if max(a) == a[1] or min(a) == a[1]:
            if max(b) == b[1] or min(b) == b[1]:
                print("Yes")
                sys.exit()

    # count up
    if y == 2:
        x += 1
        y = 0
    else:
        y += 1

print("No")
0