Submission #255218

# Submission time Handle Problem Language Result Execution time Memory
255218 2020-07-31T14:49:56 Z a_player Roses (BOI20_roses) C++14
0 / 100
1 ms 256 KB
#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*C>A*D){
        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
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -