Submission #558099

#TimeUsernameProblemLanguageResultExecution timeMemory
558099nguyen31hoang08minh2003Tarifa (COCI16_tarifa)C++14
50 / 50
1 ms340 KiB
/* 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 timeMemoryGrader output
Fetching results...