# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
98255 | dalgerok | Tarifa (COCI16_tarifa) | C++17 | 3 ms | 384 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.
#include<bits/stdc++.h>
#define int long long
using namespace std;
int x, n, p;
main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> x >> n;
int ans = 0;
for(int i = 1; i <= n; i++){
cin >> p;
ans = max(0LL, (ans + x) - p);
}
cout << ans + x;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |