結果
問題 |
No.1366 交換門松列・梅
|
ユーザー |
![]() |
提出日時 | 2022-11-07 18:16:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 1,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-06-20 11:07:46 |
合計ジャッジ時間 | 1,332 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
import itertools def is_kadomatsu(lst): return len(set(lst)) == 3 and (lst[1] == max(lst) or lst[1] == min(lst)) def main(): a = list(map(int, input().split())) b = list(map(int, input().split())) for i, j in itertools.product(range(3), repeat=2): a[i], b[j] = b[j], a[i] if is_kadomatsu(a) and is_kadomatsu(b): print("Yes") return a[i], b[j] = b[j], a[i] print("No") if __name__ == "__main__": main()