# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
558099 | nguyen31hoang08minh2003 | Tarifa (COCI16_tarifa) | C++14 | 1 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
Saturday
May 7th, 2022
03:30 AM
07/05/2022
UTC +07
*/
#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) int((x).size())
template<class A, class B>
bool minimize(A &a, const B& b) {
return a <= b ? false : (a = b, true);
}
template<class A, class B>
bool maximize(A &a, const B& b) {
return a >= b ? false : (a = b, true);
}
template<class X, class Y>
std::ostream& operator << (std::ostream& outputStream, const std::pair<X, Y> &p) {
return outputStream << '{' << p.first << ", " << p.second >> '}';
}
template<class T>
std::ostream& operator << (std::ostream& outputStream, const std::vector<T>& values) {
outputStream << '{';
for (const T& value : values)
outputStream << value << ' ';
return outputStream << '}';
}
using namespace std;
const int MAX_N = 105;
signed main() {
int x, n, p[MAX_N], result = 0;
// freopen("input.INP", "r", stdin);
cin.tie(0) -> sync_with_stdio(0);
cout.tie(0);
cin >> x >> n;
for (int i = 0; i < n; ++i) {
cin >> p[i];
result += x - p[i];
}
result += x;
cout << result << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |