Submission #719773

#TimeUsernameProblemLanguageResultExecution timeMemory
719773BoomydayFancy Fence (CEOI20_fancyfence)Pypy 3
30 / 100
132 ms37084 KiB
MOD = 1000000007 inv2 = pow(2, MOD-2, MOD) def calc_num(w, h): return w*(w+1)*h*(h+1)*inv2*inv2 % MOD N = int(input()) h, w = [0], [0] h += list(map(int, input().split())) w += list(map(int, input().split())) rsm = 0 scr = 0 for i in range(N, 0, -1): rsm += w[i] scr += calc_num(rsm, h[i]) - calc_num(rsm, h[i-1]) scr %= MOD print(scr)
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...