# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
113279 |
2019-05-24T15:49:56 Z |
CaQtiml |
Tarifa (COCI16_tarifa) |
C++14 |
|
2 ms |
384 KB |
#include "bits/stdc++.h"
using namespace std;
int arr[120];
int main()
{
int n;
cin >> n;
int rob;
cin >> rob;
int now=n;
for(int i=1;i<=rob;i++)
{
int op;
cin >> op;
if(now-op>=0)
{
now-=op;
now+=n;
}
else
{
cout << now;
exit(0);
}
}
cout << now;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
2 ms |
384 KB |
Output is correct |
7 |
Correct |
2 ms |
256 KB |
Output is correct |
8 |
Correct |
2 ms |
384 KB |
Output is correct |
9 |
Correct |
2 ms |
384 KB |
Output is correct |
10 |
Correct |
2 ms |
384 KB |
Output is correct |