codeforces 19/11/06 div2C. Tile Painting

Posted thjkhdf12

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了codeforces 19/11/06 div2C. Tile Painting相关的知识,希望对你有一定的参考价值。

技术图片
 1 #include <iostream>
 2 using namespace std;
 3  
 4 typedef long long LL;
 5  
 6 LL gcd(LL a, LL b)
 7 {
 8     if (!b) return a;
 9     return gcd(b, a % b);
10 }
11  
12 int min(int a, int b)
13 {
14     return a < b ? a : b;
15 }
16  
17 int main() 
18 {
19     LL x;
20     cin >> x;
21     LL div = x;
22     LL i = 2;
23     while (i * i <= x)
24     {
25         if (x % i == 0) div = gcd(div, gcd(i, x / i));
26         if (i & 1) i++;
27         i++;
28     }
29     cout << min(div, x) << endl;
30 }
View Code

 

以上是关于codeforces 19/11/06 div2C. Tile Painting的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #620 Div2C Air Conditioner

枚举Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) Div2C题

codeforces 19/11/06 div2D. 0-1 MST

codeforces 19/11/06 div2A. Maximum Square

Codeforces #Round 785(Div.2)

CodeForces841C. Leha and Function(Codeforces Round #429 (Div. 2))