結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2021-04-23 00:32:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 54 ms / 5,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 60,288 KB |
最終ジャッジ日時 | 2024-07-04 06:37:50 |
合計ジャッジ時間 | 2,073 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import sysimport itertoolsstdin=sys.stdinip=lambda: int(sp())fp=lambda: float(sp())lp=lambda:list(map(int,stdin.readline().split()))sp=lambda:stdin.readline().rstrip()Yp=lambda:print('Yes')Np=lambda:print('No')N = ip()A = lp()B = lp()P = list(itertools.permutations(A,N))Q = list(itertools.permutations(B,N))All = len(P) * len(Q)win = 0for a in P:for b in Q:res = 0for turn in range(N):if a[turn] > b[turn]:res += 1if res > N - res:win += 1print(win / All)