1 solutions

  • 1
    @ 2024-10-1 11:33:17

    太简单了

    #include<bits/stdc++.h>
    using namespace std;
    int a[118],n,ans=0;
    int findmax(){
    	int maxn=-0x3f;
    	for(int i=0;i<n;i++){maxn=max(maxn,a[i]);}
    	return maxn;
    }
    int main(){
    	cin>>n;
    	for(int i=0;i<n;i++)cin>>a[i];
    	for(int i=0;i<n;i++){if(a[i]!=findmax()){ans+=a[i];}}
    	cout<<ans;
    	return 0; 
    }
    
    • 1

    Information

    ID
    6938
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    1
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By