Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
163485 王垚植 22不与最大数相同的数字之和 C++ Accepted 1 MS 268 KB 323 2026-10-25 14:28:25

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; int mx=a[0]; for(int i=1;i<n;i++) mx=max(mx,a[i]); long long sum=0; for(int i=0;i<n;i++){ if(a[i]!=mx) sum+=a[i]; } cout<<sum<<'\n'; return 0; }