結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2017-02-22 15:59:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-25 03:48:36 |
合計ジャッジ時間 | 1,526 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
#!/usr/bin/env python # -*- coding: utf-8 -*- from itertools import permutations n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] cnt = win = 0 for i in permutations(a, n): cnt += 1 w = 0 for x, y in zip(i, b): if x > y: w += 1 elif x < y: w -= 1 if w > 0: win += 1 print(win / cnt)