您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 4浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Fair Numbers (brute force)

对方正在debug 发布时间:2020-12-26 12:28:03 ,浏览量:4

题目 题意:定义一个数为Fari number,如果它能被它的每一位数的数字整除。给定数n,求不小于n的最小fair number。 思路:由于{1,2,3,…,9}的最小公倍数是2520,因此找ans是可以暴力找的。

#include
using namespace std;
#define ll long long
const ll mx = 1e18;

bool check(ll x) {
	ll a = x;
	int mp[10];
	memset(mp, 0, sizeof(mp));
	while (a) {
		int num = a % 10;
		a /= 10;
		if (num) mp[num] = 1;
	}
	for (int i = 2; i             
关注
打赏
1664895754
查看更多评论
0.0424s