Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92583 LJY 22不与最大数相同的数字之和 C++ Wrong Answer 1 MS 268 KB 291 2024-10-05 17:27:56

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; const int N=100000; int n; int sum; int a[N]; bool cmp(int a,int b){ return a<b; } int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+n+1,cmp); for(int i=1;i<=n-1;i++){ sum+=a[i]; } cout<<sum; return 0; }


Run Info:

------Input------
71 38 27 41 58 56 58 70 80 27 80 76 56 18 70 56 97 23 18 70 58 63 60 21 71 41 88 10 90 90 8 78 19 10 56 97 19 54 8 77 77 55 58 80 55 92 21 37 22 83 93 56 38 22 11 84 21 15 31 92 10 92 65 69 78 1 69 95 78 10 3 3
------Answer-----
3459
------Your output-----
3556