Submission #64504

#TimeUsernameProblemLanguageResultExecution timeMemory
64504theknife2001Tarifa (COCI16_tarifa)C++17
50 / 50
4 ms520 KiB
#include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; int n; cin>>n; int a; int last=0; for(int i=0;i<n;i++) { cin>>a; last+=x; last-=a; last=max(last,0); } cout<<last+x<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...