| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 255216 | a_player | Roses (BOI20_roses) | C++14 | 1 ms | 256 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;
typedef long long ll;
int main(){
ll A,B,C,D,N;
cin>>N>>A>>B>>C>>D;
if(B*D>A*C){
swap(A,C);
swap(B,D);
}
ll q=N/A;
ll sol=q*B;
ll p=(N%A)/C;
if(p*C<N%A)p++;
if(p*D<B)sol+=p*D;
else sol+=B;
cout<<sol;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
