結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2021-08-02 22:30:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 313 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-09-16 14:47:19 |
合計ジャッジ時間 | 2,049 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertoolsN = int(input())lsA = list(map(int,input().split()))lsB = list(map(int,input().split()))lspa = itertools.permutations(lsA,N)lspb = itertools.permutations(lsB,N)cntall = 0cntwin = 0for A in lspa:for B in lspb:point = 0for i in range(N):if A[i] > B[i]:point += 1if point > N//2:cntwin += 1cntall += 1print(cntwin/cntall)