Submission #255216

# Submission time Handle Problem Language Result Execution time Memory
255216 2020-07-31T14:44:57 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*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
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 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 0 ms 256 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -