結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-02 11:53:54 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 94 ms / 5,000 ms |
| + 390µs | |
| コード長 | 316 bytes |
| 記録 | |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 15,868 KB |
| 最終ジャッジ日時 | 2026-08-28 19:54:47 |
| 合計ジャッジ時間 | 4,323 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_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()))
game, win = 0, 0
for X in permutations(B, N):
game += 1
cnt = 0
for a, b in zip(A, X):
if a > b:
cnt += 1
if 2*cnt > N:
win += 1
print(win/game)