我是靠谱客的博主 善良溪流,这篇文章主要介绍2021蓝桥杯:货物摆放,现在分享给大家,希望可以做个参考。

在这里插入图片描述

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
/*使用int型大小不够,要用long long int*/
typedef long long LL;
set<LL> a;
int main()
{
	LL n=2021041820210418;
	/*循环取出n的所有因数*/
	for (LL i = 1; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			//满足这个条件下i是一个因数,n/i也是一个因数
			a.insert(i);
			a.insert(n / i);
		}
	}
	int ans = 0;
	/*循环寻找答案*/
	for(auto b:a)
		for(auto c:a)
			for (auto d : a)
			{
				if (b * c * d == n)
					ans++;
			}
	cout << ans;
	return 0;
}

最后

以上就是善良溪流最近收集整理的关于2021蓝桥杯:货物摆放的全部内容,更多相关2021蓝桥杯内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(128)

评论列表共有 0 条评论

立即
投稿
返回
顶部