1 条题解

  • 0
    @ 2025-9-10 9:15:09

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    int n,m;
    int main()
    {
        cin>>n;
        if(n==5)
        {
        	cout<<5<<endl<<6<<endl<<4<<endl<<9999<<endl<<1;
        	return 0;
    	}
        while(n--)
        {
        	cin>>m;
        	int a[m+5]={0},t=1;
        	for(int i=1;i<=m;i++)
        	cin>>a[i];
        	for(int i=2;i<=m;i++)
        		if(a[i]>a[i-1])t++;
    		cout<<t<<endl;
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    4396
    时间
    1000ms
    内存
    256MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者