This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
int main() {
int n,d[100000];
int ans = 0;
cin >> n;
for(int i = 0;i < n;i++) {
cin >> d[i];
}
if(n==1) {
cout << 0;
return 0;
}
for(int i = 0;i < n-1;i++) {
ans += d[i]+d[i+1];
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |