結果
問題 |
No.133 カードゲーム
|
ユーザー |
![]() |
提出日時 | 2020-03-31 18:41:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-24 22:56:35 |
合計ジャッジ時間 | 1,403 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import permutations import sys input = sys.stdin.readline def main(): N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) a_win, total = 0, 0 for a in permutations(A): for b in permutations(B): a_, b_ = 0, 0 for i in range(N): if a[i] > b[i]: a_ += 1 elif a[i] < b[i]: b_ += 1 if a_ > b_: a_win += 1 total += 1 print(a_win/total) if __name__ == "__main__": main()