結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-11 03:21:22 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 5,000 ms |
| + 788µs | |
| コード長 | 473 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 16,636 KB |
| 最終ジャッジ日時 | 2026-07-28 09:41:32 |
| 合計ジャッジ時間 | 5,198 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
from itertools import groupby, accumulate, product, permutations, combinations
from statistics import mean
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = []
for p in permutations(A,N):
for q in permutations(B,N):
cnt = 0
for i in range(N):
if p[i]>q[i]:
cnt += 1
if cnt>N//2:
ans.append(1)
else:
ans.append(0)
ans = mean(ans)
print(ans)