能帮忙看看为什么才20吗 const { readline, print } = require("@ip-algorithmics/codeforces-io"); function calculateResult(n, a) { const MOD = 1e9 + 7; let result = 0; let tmp = 0; for (let i = 0; i < n; i++) { tmp += (i + 1); result += (a[i] * tmp * (n - i) % MOD); result %= MOD; } return result; } let nums = readline(); let line = readline(); let arr = line.split(" ").map(Number); print(calculateResult(nums, arr));
点赞 1

相关推荐

11-08 13:58
门头沟学院 Java
程序员小白条:竟然是蓝桥杯人才doge,还要花钱申领的offer,这么好的公司哪里去找
点赞 评论 收藏
分享
牛客网
牛客企业服务