結果

問題 No.1366 交換門松列・梅
ユーザー Fullmoon85072Fullmoon85072
提出日時 2021-11-15 21:47:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 924 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 71,684 KB
最終ジャッジ日時 2023-08-21 16:47:57
合計ジャッジ時間 3,174 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,656 KB
testcase_01 AC 84 ms
71,568 KB
testcase_02 AC 83 ms
71,304 KB
testcase_03 AC 84 ms
71,296 KB
testcase_04 WA -
testcase_05 AC 85 ms
71,600 KB
testcase_06 AC 85 ms
71,664 KB
testcase_07 AC 84 ms
71,112 KB
testcase_08 AC 85 ms
71,420 KB
testcase_09 AC 85 ms
71,620 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 86 ms
71,540 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

    # judge
    if len(a) != len(set(a)) or len(b) != len(set(b)):
        print("No")
        sys.exit()

    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