結果
問題 | No.2008 Super Worker |
ユーザー |
![]() |
提出日時 | 2022-07-15 22:03:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 547 ms / 2,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 415 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 51,260 KB |
最終ジャッジ日時 | 2024-06-27 18:02:18 |
合計ジャッジ時間 | 9,005 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) MOD = 10**9+7 AB = [(a,b) for a,b in zip(A,B)] INF = float('inf') AB.sort(key=lambda x:INF if x[1] == 1 else x[0]/(x[1]-1)) l = 1 ans = 0 for a,b in AB: ans += a*l ans %= MOD l *= b l %= MOD print(ans)