| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1305723 | guardianec | Tarifa (COCI16_tarifa) | C++20 | 1 ms | 644 KiB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll x,n;
cin >> x >> n;
ll s = 0;
for (int i=0; i<n; i++){
ll p;
cin >> p;
if (x-p+s>0) s=x-p+s;
}
cout << s+x;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
