Problems
Number of divisors
cpp:
include <iostream>
include <algorithm>
include <vector>
using namespace std;
int main() { iosbase::syncwith_stdio(0); cin.tie(0); int n; cin >> n; int cnt = 0; for(int i=1; i<=n/2; i++){ if(n%i == 0){ cnt++; } } cout << cnt+1;
return 0;
}
..
python:
import math n = int(input()) ans = 0 for i in range(1,int(math.ceil(math.sqrt(n)))): if n%i == 0: ans += 1 eded = 0 if math.ceil(math.sqrt(n))**2 == n: eded = 1 print(ans*2+eded)
n=int(input()) o=0 i=2 while i<=n: if n%i==0: o+=1 i+=1 print(o+1)