forked from wandering007/ProjectEuler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP99.cpp
More file actions
44 lines (43 loc) · 977 Bytes
/
P99.cpp
File metadata and controls
44 lines (43 loc) · 977 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
#include<iostream>
#include<fstream>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iomanip>
#define MAXN 10000000
#define MOD 10000000000
#define LL long long
#define eps 1e-8
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
clock_t start = clock();
freopen( "C:\\Users\\Leo Cheng\\Desktop\\p099_base_exp.txt", "r", stdin );//×¢ÒâʹÓÃ"\\"±íʾ·¾¶
double Max = 0.0, temp;
int a, b, rec;
for( int i = 1; i<= 1000; i++ )
{
scanf( "%d,%d", &a, &b );
temp = b * log( a );
if( temp > Max - eps )
{
Max = temp;
rec = i;
}
}
printf("%d\n", rec);
printf( "time cost: %lf", ( double )( clock() - start ) / CLOCKS_PER_SEC );
return 0;
}