結果
| 問題 | 
                            No.2008 Super Worker
                             | 
                    
| コンテスト | |
| ユーザー | 
                             june19312
                         | 
                    
| 提出日時 | 2022-07-16 00:19:32 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 299 bytes | 
| コンパイル時間 | 162 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 140,056 KB | 
| 最終ジャッジ日時 | 2024-06-27 22:11:20 | 
| 合計ジャッジ時間 | 5,506 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 TLE * 1 -- * 12 | 
ソースコード
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
mod = 10**9+7
C = []
for i in range(N):
    tmp = (B[i]-1)/A[i]
    C.append([tmp,i])
C.sort(reverse=True)
level = 1
ans = 0
for i,ii in C:
    ans+=level*A[ii]
    ans = ans%mod
    level*=B[ii]
print(ans)
            
            
            
        
            
june19312