Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
52878 AK2022071311 数学,很美妙吧 C++ 运行超时 0 1000 MS 348 KB 761 2022-07-20 12:05:55

Tests(0/10):


#include<iostream> #include<cstdio> #include<cmath> using namespace std; inline int read(){ int x = 0, f = 1; char ch = getchar(); while(ch < '0' && ch > '9'){ if(ch == '-') f = -1; ch = getchar(); } while(ch >= '0' && ch <= '9'){ x = x * 10 + ch - 48; ch = getchar(); } return x * f; } const int MOD = 1e9 + 7; int n, k, m; int dfs(int dep, int maxn, int tot, long long sum){ if(dep == k && tot == n) return sum; if(dep == k) return 0; long long temp = 0; for(int i = maxn; i <= n / (k - dep); i++) temp = (temp + dfs(dep + 1, i, tot + i, sum + (long long)pow(1ll * i, m) % MOD)) % MOD; return temp; } int main(){ n = read(), k = read(), m = read(); cout << dfs(0, 1, 0, 0) << endl; return 0; }


测评信息: