免费开源AI图像放大神器:5分钟学会Upscayl终极指南
2026/8/12 13:30:00
Problem: 1716. 计算力扣银行的钱
等比数列求和的,28,28 + 7, 28 + 7 * 2,最后累加上余数
耗时100,
class Solution { public: int totalMoney(int n) { int id = n / 7; int sum = (28 + 28 + max(0, (id - 1)*7)) * id / 2; int now = 1 + id; for(int i = id * 7; i <n; i++ ) { sum += (now++); } return sum; } };