結果
| 問題 |
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 permutations
N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split()))
judge = N // 2
cnt1 = 0
cnt2 = 0
for cards_A in permutations(A):
for cards_B in permutations(B):
cnt1 += 1
point = 0
for ca, cb in zip(cards_A, cards_B):
if ca > cb:
point += 1
if point > judge:
cnt2 += 1
print(cnt2 / cnt1)