F - 数位乘积

传送门:https://cn.vjudge.net/contest/312579#problem/F这道题我一直WA 下来问了一下别人结果发现个位数我们就直接输出N就行了 不需要输出N*10+N我就是一个菜鸡 而且写的递归函数的终止条件也不是很好 唉-------#include<set>#include<map>#include<string.h>...
摘要由CSDN通过智能技术生成

传送门:https://cn.vjudge.net/contest/312579#problem/F

这道题我一直WA 下来问了一下别人结果发现个位数我们就直接输出N就行了 不需要输出N*10+N
我就是一个菜鸡 而且写的递归函数的终止条件也不是很好 唉-------

#include<set>
#include<map>
#include<string.h>
#include<string>
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<math.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f

using namespace std;



int a[1000000],b[1000000];
int n,cnt=0;
bool f=0;
void dfs(int n,int x,int sum)
{
    if(f)
        return ;
    if(n==1)
    {
        f=1;
        cnt=x;
        for(int i=0; i<cnt; i++)
        {
            b[i]=a[i];
            printf("b[%d]=%d\n",i,b[i]);//开拓一个个B[maxn]数组来储存每一次最大可除的数字
        }
        return ;
    }
    for(int i=9; i>=2; i--)
    {
        if(n%i==0)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值