結果

問題 No.2008 Super Worker
ユーザー chineristACchineristAC
提出日時 2022-07-15 21:25:25
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 503 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 146,120 KB
最終ジャッジ日時 2023-09-10 00:28:31
合計ジャッジ時間 10,566 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
74,668 KB
testcase_01 AC 111 ms
74,432 KB
testcase_02 AC 111 ms
74,816 KB
testcase_03 AC 112 ms
74,544 KB
testcase_04 AC 111 ms
74,512 KB
testcase_05 AC 111 ms
74,864 KB
testcase_06 AC 113 ms
74,900 KB
testcase_07 AC 111 ms
74,896 KB
testcase_08 AC 112 ms
74,620 KB
testcase_09 AC 115 ms
74,348 KB
testcase_10 AC 113 ms
74,456 KB
testcase_11 AC 108 ms
74,424 KB
testcase_12 AC 113 ms
74,592 KB
testcase_13 AC 119 ms
79,376 KB
testcase_14 AC 118 ms
79,668 KB
testcase_15 AC 121 ms
79,876 KB
testcase_16 AC 120 ms
79,568 KB
testcase_17 AC 122 ms
79,656 KB
testcase_18 AC 121 ms
79,544 KB
testcase_19 AC 116 ms
78,832 KB
testcase_20 AC 119 ms
79,544 KB
testcase_21 AC 121 ms
79,668 KB
testcase_22 AC 117 ms
78,836 KB
testcase_23 AC 491 ms
146,120 KB
testcase_24 AC 494 ms
145,912 KB
testcase_25 AC 488 ms
145,860 KB
testcase_26 AC 503 ms
145,932 KB
testcase_27 AC 493 ms
146,060 KB
testcase_28 AC 471 ms
143,128 KB
testcase_29 AC 469 ms
142,960 KB
testcase_30 AC 471 ms
143,128 KB
testcase_31 AC 464 ms
143,088 KB
testcase_32 AC 465 ms
142,912 KB
testcase_33 AC 231 ms
145,032 KB
testcase_34 AC 466 ms
142,936 KB
testcase_35 AC 231 ms
144,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

"""
ai + bi * aj > aj + bj* ai

aj (bi-1)  > ai (bj-1)
bi-1/ai
"""

N = int(input())
A = li()
B = li()

idx = [i for i in range(N)]
idx.sort(key=lambda i:(B[i]-1)/A[i],reverse=True)

x = 1
res = 0
mod = 10**9 + 7
for i in idx:
    a,b = A[i],B[i]
    res += a * x % mod
    res %= mod
    x = x * b % mod

print(res)
0