結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-04 20:19:42 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 291 ms / 5,000 ms |
| + 583µs | |
| コード長 | 494 bytes |
| 記録 | |
| コンパイル時間 | 58 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 34,304 KB |
| 最終ジャッジ日時 | 2026-09-10 07:35:25 |
| 合計ジャッジ時間 | 9,052 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import itertools
import numpy as np
N = int(input())
cards_a = list(map(int, input().split()))
cards_b = list(map(int, input().split()))
total = 0
win_a = 0
for pattern_a in itertools.permutations(cards_a):
for pattern_b in itertools.permutations(cards_b):
pattern_a = np.array(list(pattern_a))
pattern_b = np.array(list(pattern_b))
fight = np.sum(pattern_a > pattern_b)
if fight > N - fight:
win_a += 1
total += 1
print(win_a / total)