3 solutions

  • 0
    @ 2024-11-8 18:01:01
    #include<bits/stdc++.h>
    using namespace std;
    int a[114514];
    int main(){
        int n,min1=INT_MAX,/*what's the meaning */max1=INT_MIN;cin>>n;
        for(int i=0;i<n;i++){
            cin>>a[i];
            min1=min(a[i],min1);
            max1=max(a[i],max1);
        }
        cout<<max1-min1;
        return 0;
    }
    

    Information

    ID
    419
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    (None)
    # Submissions
    68
    Accepted
    26
    Uploaded By