|
|
back to boardHelp,plz..WA#8 WA#8 #include<iostream>; using namespace std; int main() { int a[100002],i,n,record,maxrecord,irecord,imax,nmax; cin >> n; cin >>a[1]; imax=1; nmax=a[1]; record=1; irecord=1; maxrecord=1; for(i=2;i<=n;i++) { cin >> a[i]; if (a[i]>nmax) { ++record; if (maxrecord<record) { maxrecord=record; irecord=imax; } } else { imax=i; nmax=a[i]; record=1; } } cout << irecord; system ("PAUSE"); return 0; } |
|
|