Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
67779 陈柏诚 集合 C++ 通过 100 0 MS 264 KB 317 2023-01-19 11:16:53

Tests(10/10):


#include<bits/stdc++.h> #define ll unsigned 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 * k <= n && p) { tot *= k; ans += tot; p--; } ans += (n * p); cout << ans << endl; }


测评信息: