| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1306264 | guardianec | Tarifa (COCI16_tarifa) | C++20 | 2 ms | 584 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;
s=x-p+s;
if (s<0) s = 0;
}
cout << s+x;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
