結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-02-05 06:03:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 1,079 ms / 5,000 ms |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 82,988 KB |
| 最終ジャッジ日時 | 2026-06-27 09:21:07 |
| 合計ジャッジ時間 | 21,233 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import random
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
def judge(xs, ys):
win = 0
for x, y in zip(xs, ys):
if x > y:
win += 1
else:
win -= 1
return win > 0
trials = 1_000_000
win = 0
for _ in range(trials):
a = A[:]
b = B[:]
random.shuffle(a)
random.shuffle(b)
if judge(a, b):
win += 1
ans = win / trials
print(ans)
norioc