Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
67776 | 陈柏诚 | 集合 | C++ | 解答错误 | 90 | 0 MS | 260 KB | 303 | 2023-01-19 11:08:55 |
#include<bits/stdc++.h> #define ll long long using namespace std; ll n, k, p; ll tot = 1, ans; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> n >> k >> p; while(tot <= n / k) { tot *= k; ans += tot; p--; } ans += (n * p); cout << ans << endl; }