Submission #642403

# Submission time Handle Problem Language Result Execution time Memory
642403 2022-09-19T11:05:57 Z cigneve Roses (BOI20_roses) C++14
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long N,A,B,C,D;
  cin >> N >> A >> B >> C >> D;
  long long ret=INT_MAX;
  for(long long n1=0;n1<=ceil(N/A+A);n1++){
    long long n2=ceil(((double)(N-n1*A))/C);
    ret=min(ret,n1*B+n2*D);
  }
  printf("%lld\n",ret);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -