编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#4660 #1022. 相等步数 Compile Error 0 0 ms 0 K C++ 17 (Clang) / 310 B s230026047 2024-01-17 15:16:31
显示原始代码
#include <bits/stdc++.h>
using namespace std;
int n = 0, cnt = 0;
vector<int> a(n);
int main() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    int min_value = *min_element(a.begin(), a.end());
    for (int i = 0; i < n; i++) cnt += abs(a[i] - min_value);
    cout << cnt << endl;
    return 0;

编译信息

/sandbox/1/a.cpp:11:14: error: expected '}'
    return 0;
             ^
/sandbox/1/a.cpp:5:12: note: to match this '{'
int main() {
           ^
1 error generated.