- 金币
SB
- 2025-7-6 13:22:19 @
#include
using namespace std;
int main() {
int k;
cin >> k;
int n = 1;
int days = 0;
int total = 0;
while (days < k) {
int currentDays = n;
int realDays = min(currentDays, k - days);
total += n * realDays;
days += realDays;
n++;
} cout << total << endl;
return 0;
}
信息
- ID
- 528
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- 递交数
- 264
- 已通过
- 121
- 上传者