結果

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

ソースコード

diff #

def check(A):
  return (A[1]-A[0])*(A[1]-A[2])>0 and len(set(A))==3

def solve():
  A = list(map(int, input().split()))
  B = list(map(int, input().split()))
  for i in range(3):
    for j in range(3):
      C = A[:]; D = B[:]
      C[i], D[j] = D[j], C[i]
      if check(C) and check(D):
        return 'Yes'
  return 'No'
print(solve())
0