-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path008.cpp
More file actions
41 lines (38 loc) · 1.55 KB
/
008.cpp
File metadata and controls
41 lines (38 loc) · 1.55 KB
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
#include <bits/stdc++.h>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
signed char val[] =
"731671765313306249192251196744265747423553491949349698352031277450632623"
"957831801698480186947885184385861560789112949495459501737958331952853208"
"805511125406987471585238630507156932909632952274430435576689664895044524"
"452316173185640309871112172238311362229893423380308135336276614282806444"
"486645238749303589072962904915604407723907138105158593079608667017242712"
"188399879790879227492190169972088809377665727333001053367881220235421809"
"751254540594752243525849077116705560136048395864467063244157221553975369"
"781797784617406495514929086256932197846862248283972241375657056057490261"
"407972968652414535100474821663704844031998900088952434506585412275886668"
"811642717147992444292823086346567481391912316282458617866458359124566529"
"476545682848912883142607690042242190226710556263211111093705442175069416"
"589604080719840385096245544436298123098787992724428490918884580156166097"
"919133875499200524063689912560717606058861164671094050775410022569831552"
"0005593572972571636269561882670428252483600823257530420752963450";
int digits = 13, n = 0;
unsigned long long y = 0;
while (n <= 1000 - digits) {
unsigned long long x = 1;
for (int i = n; i < n + digits; i++) {
x *= (val[i] - '0');
}
if (x > y) {
y = x;
}
n++;
}
cout << y << "\n";
return 0;
}