fork(5) download
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a[100005];
  6.  
  7. int main() {
  8. int n; cin >> n;
  9. for(int i = 0; i < n; i++) {
  10. cin >> a[i];
  11. }
  12. int i = n-1;
  13. while(i > 0 && a[i-1] < a[i]) {
  14. i--;
  15. }
  16. cout << i << endl;
  17. }
  18.  
Success #stdin #stdout 0s 3244KB
stdin
Standard input is empty
stdout
-1218482189