Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
27
// Example program #include <iostream> using namespace std; //sfml int main() { int n; cin >> n; int a[8]; int max = -1 , maxPr = -1; int t1, t2, t3; for(int i = 0; i<8; i++){ cin >> a[i]; //cout << a[i] << " "; } //cout << endl; for(int i = 0; i<(n-8); i++){ cin >> t1; //cout << a[0] << " " << t1 <<endl; if(a[0] > max){ max = a[0]; //cout << a[0] << " " << t1 <<endl; } t2 = a[0]; for(int k = 1; k<8; k++){ t3 = a[k]; a[k] = t2; t2 = t3; } a[0] = t1; /*for(int k = 0; k<8; k++){ cout << a[k] << " "; } cout << endl;*/ if(max*t1>maxPr){ maxPr = max*t1; } //a[0] = t1; } cout << maxPr; return 0; }
run
|
edit
|
history
|
help
0
D.E.Shaw Binary Search Question
srednie
Building squares using smallest amount of matches
2
code
big boom!
UB mutex lock
typedef
constructing object on first use as return value of (pointer to) object-returning function
SayHi