1 solutions

  • 0
    @ 2025-12-3 8:19:18

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int n,ans,a[100005];
    int main()
    {
    	cin>>n;
    	for(int i=1;i<=n;i++)
    		cin>>a[i];
    	int tmp=0;
    	for(int i=1;i<=n+1;i++)
    		if(a[i]>a[i-1]) tmp++;
    		else {
    			if(tmp>=2) ans++;
    			tmp=1;
    		}
    	cout<<ans;
    	return 0;
    }
    
    • 1

    Information

    ID
    732
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    6
    Tags
    # Submissions
    63
    Accepted
    21
    Uploaded By