定义 ∀ a , b ∈ N , 若 g c d ( a , b ) = 1 , 则称 a , b 互质 \forall a,b \in \mathbb{N},若gcd(a,b)=1,则称a,b互质 ∀a,b∈N,若gcd(a,b)=1,则称a,b互质。 对于三个数或更多个数的情况,我们把 g c d ( a , b , c ) = 1 gcd(a,b,c)=1 gcd(a,b,c)=1的情况称
3377. 约数的个数 - AcWing题库 #include <bits/stdc++.h>using namespace std;int n;int Get(int x){int ans = 0;for(int i = 1;i <= x / i; i ++){if(x % i == 0 && i != x / i) ans += 2;if(x % i == 0 && i == x / i
Problem C — limit 1 second Fear Factoring The Slivians are afraid of factoring; it’s just, well, difficult. Really, they don’t even care about the factors themselves, just how much they sum to. We can
约数的个数 代码 # 计数def f(x)->int:cnt = 0i = 1while i * i <= x:if x % i == 0:cnt += 1if i * i < x:cnt += 1i += 1return cntn = int(input())a = list(map(int,input().split()))for i in a:print(f(i))