結果
| 問題 | No.133 カードゲーム | 
| コンテスト | |
| ユーザー |  nohtaray | 
| 提出日時 | 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 bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter
import numpy as np
if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
N = 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 = 0
s = 0
for 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 / 2
    s += 1
print(cnt / s)
            
            
            
        