Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
84686 sh25_chenyj 不与最大数相同的数字之和 C++ 通过 0 MS 252 KB 360 2026-02-19 14:20:23

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a = -100000000000000; int b = 0; int ls[4]; for(int i = 0; i < n; i ++){ int x; cin>>x; if(x > a){ a = x; b = i; } ls[i] = x; } int tot = 0; for(int j = 0; j < n; j ++){ if(j != b){ tot += ls[j]; } } cout<<tot; return 0; }


测评信息: