結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2023-08-22 17:29:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 48 ms / 5,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 509 ms |
コンパイル使用メモリ | 82,064 KB |
実行使用メモリ | 61,968 KB |
最終ジャッジ日時 | 2024-12-17 17:53:48 |
合計ジャッジ時間 | 2,373 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import permutationsN = int(input())A = list(map(int, input().split()))B = list(map(int, input().split()))win = 0cnt = 0for pa in permutations(range(N)):for pb in permutations(range(N)):cnt += 1aw = 0bw = 0for a, b in zip(pa, pb):if A[a] > B[b]:aw += 1elif A[a] < B[b]:bw += 1if aw > bw:win += 1ans = win / cntprint(ans)