190642025-11-20 09:24:04dfehervariA szomjas pincércpp17Accepted 100/10027ms760 KiB
// NOTE: it is recommended to use this even if you don't understand the following code.

#include <fstream>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // ifstream cin("input.txt");
    // ofstream cout("output.txt");

    int N,ans=0;
    cin >> N;

    vector<int> C(N);
    for (int i = 0; i < N; ++i){
        cin >> C[i];
        if(C[i]>0) --C[i];
        ans += C[i];
    }


    


    // INSERT YOUR CODE HERE


    cout << ans << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Accepted1ms316 KiB
subtask220/20
3Accepted1ms316 KiB
4Accepted1ms508 KiB
5Accepted1ms316 KiB
6Accepted1ms316 KiB
7Accepted1ms316 KiB
subtask330/30
8Accepted1ms316 KiB
9Accepted1ms508 KiB
10Accepted1ms316 KiB
11Accepted1ms316 KiB
12Accepted1ms316 KiB
13Accepted1ms316 KiB
14Accepted1ms508 KiB
15Accepted1ms316 KiB
16Accepted1ms508 KiB
17Accepted1ms316 KiB
18Accepted1ms316 KiB
subtask450/50
19Accepted1ms316 KiB
20Accepted1ms316 KiB
21Accepted1ms316 KiB
22Accepted1ms508 KiB
23Accepted1ms316 KiB
24Accepted1ms316 KiB
25Accepted1ms316 KiB
26Accepted1ms316 KiB
27Accepted1ms508 KiB
28Accepted1ms316 KiB
29Accepted1ms508 KiB
30Accepted1ms316 KiB
31Accepted1ms316 KiB
32Accepted2ms500 KiB
33Accepted3ms316 KiB
34Accepted7ms504 KiB
35Accepted12ms564 KiB
36Accepted20ms676 KiB
37Accepted8ms316 KiB
38Accepted27ms760 KiB