Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
max_recursion
//g++ 5.4.0 #include <bits/stdc++.h> using namespace std; int max (int a[],int n) { cout<<1<<endl; if(n==0) { return a[0]; } int temp=max(a,n-1); if(a[n]>temp) { cout<<2<<endl; return (a[n]); } else { return temp; } } int main() { int t,i,n,a[100009],r; cin>>t; while(t--) { cin>>n; for(i=0;i<n;i++) { cin>>a[i]; } r=max(a,n-1); cout<<r<<endl; } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
DailyExchRate2
Address Book
Using initializer_list<T>
wealth of banks
Policy based smart pointer
Rzutka gra 2
role of copy constructor
aaaaaaaaaaaa
MovConstrAssign
Value equal to index value
Please log in to post a comment.