結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2019-07-05 19:57:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 830 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,776 KB |
最終ジャッジ日時 | 2024-09-22 04:50:18 |
合計ジャッジ時間 | 2,088 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 19 |
ソースコード
import bisectimport heapqimport itertoolsimport mathimport osimport reimport stringimport sysfrom collections import Counter, deque, defaultdictfrom copy import deepcopyfrom decimal import Decimalfrom fractions import gcdfrom functools import lru_cache, reducefrom operator import itemgetterimport numpy as npif os.getenv("LOCAL"):sys.stdin = open("_in.txt", "r")sys.setrecursionlimit(2147483647)INF = float("inf")IINF = 10 ** 18MOD = 10 ** 9 + 7N = int(sys.stdin.readline())A = list(map(int, sys.stdin.readline().split()))B = list(map(int, sys.stdin.readline().split()))A = np.array(A)B = np.array(B)cnt = 0s = 0for a, b in itertools.product(itertools.permutations(range(N)), repeat=2):a = A[np.array(a)]b = B[np.array(b)]cnt += (a > b).sum() > N / 2s += 1print(cnt / s)