Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
8153 D班-西瓜 数的划分 C++ 运行超时 20 1000 MS 260 KB 277 2025-03-26 15:03:36

Tests(1/5):


#include <bits/stdc++.h> using namespace std; int n,k,cnt=0; void dfs(int s,int t,int start) { if(s == 0 && t == 0) { cnt++; } for(int i = start; i<=s; i++) { dfs(s-i,t-1,i); } } int main() { cin >> n >> k; dfs(n,k,1); cout << cnt; return 0; }


测评信息: