답안 #255218

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
255218 2020-07-31T14:49:56 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*C>A*D){
        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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -