| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1331162 | Zone_zonee | Roses (BOI20_roses) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll divide(ll a, ll b){
if(a%b == 0) return a/b;
return a/b+1;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
ll res = 2e18;
res = min(res, n/a*b + divide(n%a, c)*d);
res = min(res, divide(n, a)*b);
res = min(res, n/c*d + divide(n%c, a)*b);
res = min(res, divide(n, c)*d);
cout << res << '\n';
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
