| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 333171 | 黄浙峰老师 | 【C6-6】递归法求最大值 | C++ | Accepted | 100 | 1 MS | 244 KB | 318 | 2025-07-16 10:00:04 |
#include<bits/stdc++.h> using namespace std; int N,a[1005]; int fun(int n){ if(n==1)return 1; else if(a[n]>a[fun(n-1)]){ return n; }else if(a[n]<a[fun(n-1)]){ return fun(n-1); } } int main() { cin>>N; for(int i=1;i<=N;i++){ cin>>a[i]; } int x=fun(N); cout<<a[x]<<" "<<x; return 0; }