传统题 1000ms 128MiB

[NOIP2002 普及组] 选数

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Description

Input Format

Output Format

输出一个整数,表示种类数。
4 3
3 7 12 19
1

Hint

#include<bits/stdc++.h>
using namespace std;
int n,k,num[21],ans,a[22],s=0;
bool check(int x)
{
	//判断质数
}
void dfs(int now,int last)// now-选中个数 last-下一个选的位置
{
	if(now>k)
	{
		
		return;
	}
	for(int i=last+1;i<=n;i++)
	{
        num[now]=?;
        dfs(?,?);
	}
}
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	dfs(?,?);
	printf("%d\n",ans);
}

Source

NOIP

2024龙游暑假1期搜素专题

未参加
状态
已结束
规则
ACM/ICPC
题目
12
开始于
2024-7-9 13:00
结束于
2024-7-14 13:00
持续时间
120 小时
主持人
参赛人数
3