1 solutions

  • 1
    @ 2025-4-12 16:04:42
    #include<bits/stdc++.h>
    using namespace std;
    const int N=110;
    int a[N];
    int main()
    {
    	int n,maxv=0;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		cin>>a[i];
    		if(i>1)
    		{
    			int cnt=abs(a[i]-a[i-1]);
    			maxv=max(maxv,cnt);
    		}
    	}
    	cout<<maxv; 
    	return 0;
    }

    Information

    ID
    679
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    43
    Accepted
    19
    Uploaded By