Submission #86383

#TimeUsernameProblemLanguageResultExecution timeMemory
86383chunghan전봇대 (KOI13_pole)C++17
0 / 100
19 ms2232 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...