# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113279 | CaQtiml | Tarifa (COCI16_tarifa) | C++14 | 2 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |