fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <climits>
  4. using namespace std;
  5.  
  6. int get_max(int *A, int L, int R){
  7. if (L>R)
  8. return INT_MIN;
  9. if (L==R)
  10. return A[L];
  11. int M=(L+R)>>1;
  12. return max(get_max(A,L,M), get_max(A,M+1,R));
  13. }
  14. int main(){
  15. int A[]={373627,772,73,-233,-1,8737};
  16. int N=sizeof(A)/sizeof(A[0]);
  17. int ans=get_max(A,0,N-1);
  18. cout<<ans<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
373627