1 条题解

  • 0
    @ 2025-9-9 23:56:18

    C++ :

    #include<cstdio>
    #include<cstring>
    using namespace std;
    
    int total=0;
    int zhao(int a,int b)
    {
    	int shi=100/10;
    	int wu=100/5;
    	int er=100/2;
    	int yi=100/1;
    	int zhong=100*a;
    	for(int x=1;x<=shi;++x)
    	  for(int j=1;j<=wu;++j)
    	    for(int z=1;z<=er;++z)
    	      for(int y=1;y<=yi;++y)
    	      if(10*x+5*j+2*z+1*y==zhong&&x+j+z+y==b)
    	       ++total;
    }
    int main()
    {
    	int n,m;
    	scanf("%d%d",&n,&m);
    	zhao(n,m);
    	if(total!=0)
    	printf("%d",total);
    	else
    	printf("No");
    	return 0;
    }
    
    • 1

    信息

    ID
    2069
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者