結果
| 問題 | 
                            No.2008 Super Worker
                             | 
                    
| コンテスト | |
| ユーザー | 
                             norioc
                         | 
                    
| 提出日時 | 2025-09-26 01:11:42 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 386 bytes | 
| コンパイル時間 | 301 ms | 
| コンパイル使用メモリ | 82,508 KB | 
| 実行使用メモリ | 144,604 KB | 
| 最終ジャッジ日時 | 2025-09-26 01:11:49 | 
| 合計ジャッジ時間 | 6,033 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 TLE * 1 -- * 12 | 
ソースコード
MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
class D:
    def __init__(self, a, b):
        self.a = a
        self.b = b
        self.key = (b - 1) / a
ds = [D(a, b) for a, b in zip(A, B)]
x = 1
ans = 0
for d in sorted(ds, key=lambda x: x.key, reverse=True):
    ans += d.a * x
    ans %= MOD
    x = d.b * x
print(ans)
            
            
            
        
            
norioc