# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
130057 |
2019-07-13T20:12:28 Z |
44442 |
Tarifa (COCI16_tarifa) |
C++11 |
|
2 ms |
504 KB |
#include <bits/stdc++.h>
using namespace std;
short n,x;
int p[102],ok,a;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>x>>n;
for(int i=0;i<n;i++){
cin>>p[i];
}
for(int i=0;i<n;i++){
if(p[i]<x+a){
a=a+x-p[i];
ok=1;
}
else
ok=0;
}
if(ok==1)
cout<<a+x;
else
cout<<x;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
504 KB |
Output isn't correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |