#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<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
248 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
360 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
480 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
480 KB |
Output isn't correct |
5 |
Incorrect |
3 ms |
592 KB |
Output isn't correct |
6 |
Incorrect |
3 ms |
600 KB |
Output isn't correct |
7 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
600 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
600 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
652 KB |
Output isn't correct |