結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2019-12-23 12:09:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 429 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-16 08:05:46 |
合計ジャッジ時間 | 1,743 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import permutationsN = int(input())A = tuple(map(int, input().split()))B = tuple(map(int, input().split()))judge = N // 2cnt1 = 0cnt2 = 0for cards_A in permutations(A):for cards_B in permutations(B):cnt1 += 1point = 0for ca, cb in zip(cards_A, cards_B):if ca > cb:point += 1if point > judge:cnt2 += 1print(cnt2 / cnt1)