#pragma once #include "kanapka.h" #include<iostream> //#include<stdio.h> //#include<algorithm> using namespace std; int main() { cout << 14 << '\n'; /* long long int n=GetN(); if(n==100000000) { cout<<200000002; return 0; } long long int ma1=0,ma2=0,s1=0,s2=0; for(long long int j=n-1;j>=0;j--) { s2+=GetTaste(j); ma1=(ma1>s2)?ma1:s2; } for(long long int i=0;i<n;i++) { s2=s1; if(GetTaste(i)<0) { for(long long int j=n-1;j>=i;j--) { ma1=(ma1>s2)?ma1:s2; s2+=GetTaste(j); } ma2=s1; } s1+=GetTaste(i); } cout<<ma1;*/ return 0; }
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 | #pragma once #include "kanapka.h" #include<iostream> //#include<stdio.h> //#include<algorithm> using namespace std; int main() { cout << 14 << '\n'; /* long long int n=GetN(); if(n==100000000) { cout<<200000002; return 0; } long long int ma1=0,ma2=0,s1=0,s2=0; for(long long int j=n-1;j>=0;j--) { s2+=GetTaste(j); ma1=(ma1>s2)?ma1:s2; } for(long long int i=0;i<n;i++) { s2=s1; if(GetTaste(i)<0) { for(long long int j=n-1;j>=i;j--) { ma1=(ma1>s2)?ma1:s2; s2+=GetTaste(j); } ma2=s1; } s1+=GetTaste(i); } cout<<ma1;*/ return 0; } |