-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem29.cpp
More file actions
46 lines (41 loc) · 770 Bytes
/
Problem29.cpp
File metadata and controls
46 lines (41 loc) · 770 Bytes
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
/*
Krishna Mohan
Project Euler - Problem 29
Date: 3/22/2015
*/
#include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for(int (i)=0;(i)<(n); (i)++)
#define MOD 1000000007
#define LIM 100
typedef long long ll;
ll bigMod(ll a, ll b)
{
ll res=1;
while(b)
{
if(b&1)
res=(a*res);
a=(a*a);
b/=2;
}
return res;
}
int main()
{
ios_base::sync_with_stdio(0);
set<double> dat;
for(int i=2;i<=LIM;i++)
{
for(int j=2;j<=LIM;j++)
{
//cout<<i<<" : "<<j<<" = "<<bigMod(i,j)<<endl;
//cout<<(j*log(i))<<endl;
dat.insert(j*log(i));
}
//cout<<endl;
}
int ans=dat.size();
cout<<"Ans: "<<ans<<endl;
return 0;
}