結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2022-05-25 20:03:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 47 ms / 5,000 ms |
コード長 | 762 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 61,312 KB |
最終ジャッジ日時 | 2024-09-20 14:48:45 |
合計ジャッジ時間 | 1,959 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertoolsdef I(): return input().rstrip()def IS(): return input().split()def II(): return int(input())def IIS(): return map(int, input().split())def LIIS(): return list(map(int, input().split()))def LLIIS(n): return [LIIS() for _ in range(n)]import syssys.setrecursionlimit(100000)PLUS = [[1,0],[0,1],[-1,0],[0,-1]]INF = 10**20N = II()A = LIIS()B = LIIS()total = 0win = 0for a in itertools.permutations(range(N)):for b in itertools.permutations(range(N)):total += 1a_win = 0b_Win = 0for i in range(N):if A[a[i]] > B[b[i]]:a_win += 1elif A[a[i]] < B[b[i]]:b_Win += 1if a_win > b_Win:win += 1print(win / total)