为啥呀???
查看原帖
为啥呀???
865793
better_Z楼主2023/7/7 09:44
#include<iostream>
#include<cmath>
using namespace std;
int n,p,v,best=9999999;
int main(){
    cin>>n;
    while(cin>>p>>v){
        if(n%p==n){best=min(best,p*v);continue;}
        else if(n%p==0){best=min(best,v*(n/p));}
        else if(n%p!=0){
            best=min(best,v*(n/p+1));
        }
    }
    cout<<best;
    return 0;
}
2023/7/7 09:44
加载中...