結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-22 17:29:57 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 29 ms / 5,000 ms |
| + 206µs | |
| コード長 | 469 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 81,532 KB |
| 実行使用メモリ | 64,800 KB |
| 最終ジャッジ日時 | 2026-10-04 18:25:11 |
| 合計ジャッジ時間 | 2,633 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
win = 0
cnt = 0
for pa in permutations(range(N)):
for pb in permutations(range(N)):
cnt += 1
aw = 0
bw = 0
for a, b in zip(pa, pb):
if A[a] > B[b]:
aw += 1
elif A[a] < B[b]:
bw += 1
if aw > bw:
win += 1
ans = win / cnt
print(ans)