結果
| 問題 |
No.133 カードゲーム
|
| コンテスト | |
| ユーザー |
arubeyond
|
| 提出日時 | 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.113
n=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 ans
for i in range(len(card)):
nextcard=card.copy()
x=nextcard.pop(i)
nex=now+[x]
ans=makepop(nex,nextcard,ans)
return ans
apop=makepop([],a,[])
bpop=makepop([],b,[])
win,match=0,0
def battle(x,y):
point=0
for i in range(len(x)):
if x[i]>y[i]:point+=1
if point>len(x)/2:return 1
else:return 0
for x in apop:
for y in bpop:
win+=battle(x,y)
match+=1
print(win/match)
arubeyond