zoukankan      html  css  js  c++  java
  • nyoj 779-兰州烧饼 (ceil)

    779-兰州烧饼


    内存限制:64MB 时间限制:1000ms 特判: No
    通过数:6 提交数:8 难度:1

    题目描述:

    烧饼有两面,要做好一个兰州烧饼,要两面都弄热。当然,一次只能弄一个的话,效率就太低了。有这么一个大平底锅,一次可以同时放入k个兰州烧饼,一分钟能做好一面。而现在有n个兰州烧饼,至少需要多少分钟才能全部做好呢?

    输入描述:

    依次输入n和k,中间以空格分隔,其中1 <= k,n <= 100000

    输出描述:

    输出全部做好至少需要的分钟数

    样例输入:

    3 2

    样例输出:

    3

    C/C++:

    #include <iostream>
    #include <algorithm>
    #include <cstring>
    #include <cstdio>
    #include <cmath>
    #include <stack>
    #include <set>
    #include <map>
    #include <queue>
    #include <climits>
    #include <bitset>
    #define PI 3.1415926
    
    using namespace std;
    
    int main()
    {
        double n, p;
        while (cin >>n >>p)
        {
            double temp = n * 2 / p;
            if (temp <= 2)
                cout <<"2" <<endl;
            else
                cout <<ceil(temp) <<endl;
        }
    
        return 0;
    }
  • 相关阅读:
    备份
    Android资料之-EditText中的inputType
    trim() 是什么意思?
    两数相加
    点击edittext并显示其内容
    php 返回上一页并刷新
    sql one
    sql 语句 查询两个字段都相同的方法
    我为什么喜欢Go语言123123
    数据字典
  • 原文地址:https://www.cnblogs.com/GetcharZp/p/9353962.html
Copyright © 2011-2022 走看看