Submission #98255

#TimeUsernameProblemLanguageResultExecution timeMemory
98255dalgerokTarifa (COCI16_tarifa)C++17
50 / 50
3 ms384 KiB
#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)

tarifa.cpp:10:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...