Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
134260 曾煦翔 紧急集合 C++ 解答错误 10 2 MS 300 KB 437 2024-03-02 15:17:29

Tests(1/10):


#include <bits/stdc++.h> using namespace std; const int N = 1e5; //struct node //{ // int p , q; //}a[N]; //bool cmp(node x , node y) //{ // if(x.p != y.p) // return x.p < y.p; // return x.q < y.q; //} int a[N]; int main() { int n; cin >> n; for(int i =1 ;i <= n;i++) cin >> a[i]; sort(a + 1 , a + n + 1); int sum = a[1]; for(int i = 2;i <= n;i++) sum += a[i] + a[i - 1]; cout << sum; return 0; }


测评信息: