Codeforces Round #655 (Div. 2)-B. Omkar and Last Class of Math(LCM)
题目链接
题意:
给你一个数n,求两个和为n的数的LCM的最小值。
思路:
这个题主要是看对LCM的理解,两个数越接近n/2他们的LCM就会越小,所以我们只需要从小到大寻找n的因子,然后两个数分别就是n/i和n-n/i。
代码:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cons
原创
2020-07-12 20:49:02 ·
231 阅读 ·
0 评论