結果

問題 No.2008 Super Worker
ユーザー nephrologistnephrologist
提出日時 2022-07-16 08:39:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 698 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 135,416 KB
最終ジャッジ日時 2023-09-10 15:41:00
合計ジャッジ時間 11,752 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,260 KB
testcase_01 AC 72 ms
71,260 KB
testcase_02 AC 72 ms
71,340 KB
testcase_03 AC 72 ms
71,036 KB
testcase_04 AC 73 ms
71,300 KB
testcase_05 AC 72 ms
71,260 KB
testcase_06 AC 71 ms
71,476 KB
testcase_07 AC 72 ms
71,476 KB
testcase_08 AC 73 ms
71,268 KB
testcase_09 AC 74 ms
71,256 KB
testcase_10 AC 73 ms
71,260 KB
testcase_11 AC 72 ms
71,400 KB
testcase_12 AC 73 ms
71,252 KB
testcase_13 AC 82 ms
76,808 KB
testcase_14 AC 82 ms
76,704 KB
testcase_15 AC 81 ms
76,528 KB
testcase_16 AC 82 ms
76,500 KB
testcase_17 AC 83 ms
76,608 KB
testcase_18 AC 83 ms
76,608 KB
testcase_19 AC 79 ms
75,460 KB
testcase_20 AC 82 ms
76,808 KB
testcase_21 AC 83 ms
76,496 KB
testcase_22 AC 80 ms
75,428 KB
testcase_23 AC 686 ms
135,120 KB
testcase_24 AC 685 ms
135,344 KB
testcase_25 AC 686 ms
135,084 KB
testcase_26 AC 683 ms
135,108 KB
testcase_27 AC 698 ms
135,416 KB
testcase_28 AC 663 ms
126,476 KB
testcase_29 AC 669 ms
126,036 KB
testcase_30 AC 668 ms
126,208 KB
testcase_31 AC 661 ms
126,440 KB
testcase_32 AC 656 ms
125,904 KB
testcase_33 AC 192 ms
128,360 KB
testcase_34 AC 665 ms
126,596 KB
testcase_35 AC 153 ms
120,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

mod = 10**9+7

kouho=[]
ones=[]
for i in range(n):
    a,b=A[i],B[i]
    if b==1:
        ones.append(a)
    else:
        kouho.append((a/(1-b), a,b))

kouho.sort(reverse=True)
level=1
ans=0
for _,a,b in kouho:
    ans+=a*level%mod
    ans%=mod
    level*=b
    level%=mod
for a in ones:
    ans+=a*level%mod
    ans%=mod
    
print(ans)    
0