結果

問題 No.133 カードゲーム
ユーザー なつねこなつねこ
提出日時 2022-01-02 14:11:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 61,952 KB
最終ジャッジ日時 2024-04-19 20:24:17
合計ジャッジ時間 2,127 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,504 KB
testcase_01 AC 38 ms
53,120 KB
testcase_02 AC 36 ms
53,760 KB
testcase_03 AC 37 ms
52,864 KB
testcase_04 AC 36 ms
53,120 KB
testcase_05 AC 43 ms
60,672 KB
testcase_06 AC 46 ms
61,824 KB
testcase_07 AC 45 ms
61,568 KB
testcase_08 AC 37 ms
52,864 KB
testcase_09 AC 39 ms
52,864 KB
testcase_10 AC 45 ms
61,184 KB
testcase_11 AC 44 ms
60,672 KB
testcase_12 AC 46 ms
61,952 KB
testcase_13 AC 38 ms
53,120 KB
testcase_14 AC 38 ms
53,504 KB
testcase_15 AC 38 ms
53,376 KB
testcase_16 AC 44 ms
61,184 KB
testcase_17 AC 43 ms
60,416 KB
testcase_18 AC 42 ms
61,824 KB
testcase_19 AC 44 ms
61,056 KB
testcase_20 AC 43 ms
61,184 KB
testcase_21 AC 48 ms
61,568 KB
testcase_22 AC 45 ms
61,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import copy
N = int(input())
L1 = list(map(int, input().split()))
L2 = list(map(int,input().split()))
Shuffle1 = list(itertools.permutations(range(N)))
Numshu = len(Shuffle1)
Shuffle2 = copy.copy(Shuffle1)
ans = 0
for l in Shuffle1:
  for k in Shuffle2:
    i = 0
    for n in range(N):
      x = L1[l[n]]
      y = L2[k[n]]
      if x > y:
        i += 1
      else:
        pass
    if i > N/2:
      ans += 1
    else:
      pass
print(ans/(Numshu**2))
0