Submission #642345

#TimeUsernameProblemLanguageResultExecution timeMemory
642345cigneveRoses (BOI20_roses)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int N,A,B,C,D; cin >> N >> A >> B >> C >> D; int ret=INT_MAX; for(int n1=0;n1<=N/A;n1++){ int sm=n1*A; int n2=0; while (sm+n2*C<N){ n2++; } ret=min(ret,n1*B+n2*D); } printf("%d\n",ret); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...