Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106527 金昱帆 22砝码的重量 C++ Accepted 1 MS 272 KB 352 2025-01-16 12:22:31

Tests(10/10):


Code:

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