結果
問題 | No.2008 Super Worker |
ユーザー |
|
提出日時 | 2022-07-15 21:26:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 408 ms / 2,000 ms |
コード長 | 840 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 125,592 KB |
最終ジャッジ日時 | 2024-06-27 16:48:45 |
合計ジャッジ時間 | 7,134 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import sys, randominput = lambda : sys.stdin.readline().rstrip()sys.setrecursionlimit(3*10**5+10)write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))debug = lambda x: sys.stderr.write(x+"\n")YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); inf=10**18LI = lambda : list(map(int, input().split()))def debug(_l_):for s in _l_.split():print(f"{s}={eval(s)}", end=" ")print()def dlist(*l, fill=0):if len(l)==1:return [fill]*l[0]ll = l[1:]return [dlist(*ll, fill=fill) for _ in range(l[0])]n = int(input())a = list(map(int, input().split()))b = list(map(int, input().split()))index = list(range(n))index.sort(key=lambda i: -(b[i]-1)/a[i])c = 1ans = 0M = 10**9+7for i in index:ans += c*a[i]%Mc *= b[i]c %= Mprint(ans%M)