1 条题解

  • 0
    @ 2021-11-29 19:26:53
    /*****************************************
    备注:
    ******************************************/
    #include <queue>
    #include <math.h>
    #include <stack>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <iomanip>
    #include <string.h>
    #include <algorithm>
    using namespace std;
    #define LL long long
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    using namespace std;
    int i,j,k,n,m,w,ans;
    int main()
    {
        cin>>n;
        for(int i=0;i<3;i++)
    	{
            scanf("%d%d",&j,&k);
    		m=j;
    		w=k;
            while(j<n)
    		{
    			j<<=1;k<<=1;
    		}
            while(j>n)
    		{
    		j-=m;k-=w;
    		}
            while(j<n)
    		{
    			j+=m;k+=w;
    		}
            if(k<ans||ans==0)
    			ans=k;
        }
        cout<<ans<<endl;
        return 0;
    }
    
    • 1

    信息

    ID
    758
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    6
    已通过
    6
    上传者