Submission #86383

# Submission time Handle Problem Language Result Execution time Memory
86383 2018-11-26T08:35:03 Z chunghan 전봇대 (KOI13_pole) C++17
0 / 100
19 ms 2232 KB
#include<bits/stdc++.h>

using namespace std;

typedef long long int lld;

int N;
lld C, D, L[100005];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    cin >> N;
    for (int i = 0; i < N; i++)
        cin >> L[i];
    lld D = L[N-1]%(N-1) ? L[N-1]/(N-1)+1 : L[N-1]/(N-1);
    for (int i = 0; i < N; i++) {
        C += abs(L[i] - D*i);
    }
    cout << C;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Incorrect 2 ms 564 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 2232 KB Output isn't correct
2 Halted 0 ms 0 KB -