首页 > 其他 > 详细

【Educational Codeforces Round 36 A】 Garden

时间:2018-01-14 10:38:55      阅读:216      评论:0      收藏:0      [点我收藏+]

【链接】 我是链接,点我呀:)
【题意】


在这里输入题意

【题解】


枚举用哪一个桶就好

【代码】

#include <bits/stdc++.h>
using namespace std;

int n,k,x;

int main(){
    #ifdef LOCAL_DEFINE
        freopen("rush_in.txt", "r", stdin);
    #endif
    ios::sync_with_stdio(0),cin.tie(0);
    cin >> n >> k;
    int ma = -1;
    for (int i = 1;i <= n;i++){
        cin >> x;
        if (x<=k && k%x==0){
            if (ma==-1)
                ma = k/x;
            else
                ma = min(ma,k/x);
        }
    }
    cout <<ma<<endl;
    return 0;
}

【Educational Codeforces Round 36 A】 Garden

原文:https://www.cnblogs.com/AWCXV/p/8282304.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!