結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2021-04-08 21:00:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-23 23:40:01 |
合計ジャッジ時間 | 2,134 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertools N=int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) i_list = [i for i in range(N)] total = 0 cnt = 0 for l in itertools.permutations(i_list): a_win = 0 b_win = 0 for ind, i in enumerate(l): if a[i] > b[ind]:a_win+=1 elif b[ind] > a[i]:b_win+=1 if a_win > b_win:cnt+=1 total+=1 print(cnt/total)