結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2019-02-12 00:11:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 635 bytes |
コンパイル時間 | 80 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-20 05:00:12 |
合計ジャッジ時間 | 1,692 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
#yukicoderNO.113n=int(input())a=list(map(int,input().split()))b=list(map(int,input().split()))def makepop(now,card,ans):if len(card)==0:ans.append(now)return ansfor i in range(len(card)):nextcard=card.copy()x=nextcard.pop(i)nex=now+[x]ans=makepop(nex,nextcard,ans)return ansapop=makepop([],a,[])bpop=makepop([],b,[])win,match=0,0def battle(x,y):point=0for i in range(len(x)):if x[i]>y[i]:point+=1if point>len(x)/2:return 1else:return 0for x in apop:for y in bpop:win+=battle(x,y)match+=1print(win/match)