#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int32_t x, n;
cin >> x >> n;
int32_t curr = 0;
for(int32_t i = 1; i <= n; i++) {
curr += x;
int32_t p;
cin >> p;
curr -= p;
}
cout << curr + x << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
504 KB |
Output is correct |
2 |
Correct |
2 ms |
652 KB |
Output is correct |
3 |
Correct |
2 ms |
652 KB |
Output is correct |
4 |
Correct |
2 ms |
656 KB |
Output is correct |
5 |
Correct |
2 ms |
708 KB |
Output is correct |
6 |
Correct |
2 ms |
752 KB |
Output is correct |
7 |
Correct |
2 ms |
800 KB |
Output is correct |
8 |
Correct |
2 ms |
812 KB |
Output is correct |
9 |
Correct |
2 ms |
816 KB |
Output is correct |
10 |
Correct |
2 ms |
948 KB |
Output is correct |