Submission #642401

#TimeUsernameProblemLanguageResultExecution timeMemory
642401cigneveRoses (BOI20_roses)C++14
0 / 100
1 ms212 KiB
#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);n1++){ long long n2=ceil(((double)(N-n1*A))/C); ret=min(ret,n1*B+n2*D); } printf("%lld\n",ret); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...