1 条题解

  • 1
    @ 2026-8-18 15:37:28

    #include <bits/stdc++.h> using namespace std;

    int main() { int a[10000], x; cin >> x; int maxx = 0; int s = 0; for (int i = 0; i < x; i++) { cin >> a[i]; if (a[i] > maxx) { maxx = a[i]; } } for (int i = 0; i < x; i++) { s = s + maxx-a[i]; } cout << s; return 0; }

    • 1

    信息

    ID
    31236
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    66
    已通过
    33
    上传者