-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate.cpp
64 lines (57 loc) · 1.33 KB
/
template.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <bits/stdc++.h>
#define deb(x) cout << #x << ": " << x << endl;
#define deb2(x, y) cout << #x << ": " << x << " ~ " << #y << ": " << y << endl;
#define in(n, arr) \
for (int i = 0; i < n; i++) \
cin >> arr[i]
#define out_arr(n, arr) \
for (int i = 0; i < n; i++) \
cout << arr[i]
#define op(n) cout << n << "\n"
#define lli long long int
#define here cout << "\nHERE\n"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
// function returns unique prime factors
// eg: 30 has factors 2, 3, 5, 6, 10, 15, so function will return only 3 (2, 3, 5)
lli countUniquePrimeFactors(lli n)
{
lli cnt = 0;
for (int i = 2; i * i <= n; i++)
{
if(n%i==0)
{
++cnt;
// we don't want multiples of say 2 or 3..
while(!(n%i))
n /= i;
}
}
// if n is prime
if(n != 1)
++cnt;
return cnt;
}
int main()
{
// /*
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
// */
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
// lli n;
// cin >> n;
// vector<lli> arr(n);
// in(n, arr);
// op();
}
return 0;
}