結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-01-27 18:22:24 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 92 ms / 5,000 ms |
| + 952µs | |
| コード長 | 463 bytes |
| 記録 | |
| コンパイル時間 | 283 ms |
| コンパイル使用メモリ | 21,536 KB |
| 実行使用メモリ | 15,868 KB |
| 最終ジャッジ日時 | 2026-08-27 02:54:14 |
| 合計ジャッジ時間 | 4,437 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools
N,*AB = map(int,read().split())
A = AB[:N]
B = AB[N:]
perm_A = itertools.permutations(A)
perm_B = itertools.permutations(B)
match = 0
win = 0
for p,q in itertools.product(perm_A, perm_B):
match += 1
large = sum(x > y for x,y in zip(p,q))
small = N - large
if large > small:
win += 1
print(win / match)
maspy