結果
問題 | No.133 カードゲーム |
ユーザー | hiro5277 |
提出日時 | 2019-10-17 13:57:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 5,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-24 09:45:07 |
合計ジャッジ時間 | 1,689 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
#yukicoder No133 import itertools N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) Comb = list(itertools.permutations(B)) ans_all = len(Comb) ans_win = 0 for i in range(ans_all): B_ = list(Comb[i]) a_win = 0 b_win = 0 for j in range(len(B_)): if(A[j] > B_[j]): a_win += 1 elif(A[j] < B_[j]): b_win += 1 if(a_win > b_win): ans_win += 1 ans = ans_win/ans_all print(ans)