結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2019-09-07 01:57:39 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 505 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 81,840 KB |
実行使用メモリ | 54,304 KB |
最終ジャッジ日時 | 2024-06-25 01:10:20 |
合計ジャッジ時間 | 1,893 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 3 WA * 16 |
ソースコード
import itertools N = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) per1 = itertools.permutations(list(range(N)), N) per2 = itertools.permutations(list(range(N)), N) cnt = 0 count = 0 c = 0 for xx in per2: for x in xx: for yy in per1: cnt = 0 for y in yy: if a[x]>b[y]: cnt += 1 c += 1 if cnt > N/2: count += 1 else: ans = cnt / c print(ans)