Codevs 5314 蜗牛鲍勃找房子1——出发!

来源:互联网 发布:东京食尸鬼面具淘宝 编辑:程序博客网 时间:2024/05/18 01:20

Codevs 5314 蜗牛鲍勃找房子1——出发!

评测的时候不小心看见这个题了, 就做一下,唯一需要注意的地方是如果剩下的距离不够1分钟的速度,也按1分钟计算。

#include <cstdio>#include <cstring>#include <iostream>#include <cstdlib>using namespace std;#define T (1440)int main(){    int n, x;    cin >> n >> x;    int t = n/x;    if(t*x != n) t ++;    if(t <= T) cout << t << endl;    else puts("no");    return 0;} 
1 0
原创粉丝点击