- 博客(2)
- 收藏
- 关注
原创 c++输入读入回车
c++用cin.getline()并指定EOF结束符可以读入回车换行#include <iostream>#include <cstdio>#include <bits/stdc++.h>using namespace std;bool check(char c){ if(c == 39 || 48 <= c &&...
2019-03-08 00:16:25
4338
原创 poj3863 Business Center
题意:有m种电梯箱,每种电梯箱只有两个按钮,上u层或下d层,初始位置0层 按n次按钮,求所给的几种电梯箱最后位置的最低层(但不能是0层)思路:贪心,设上升次数为x ,则x*u-(n-x)*d>=0 解得:x>=n*d/(u+d)当能够整除时:在x取n*d/(u+d)的基础上将一次下降操作换为上升操作,最终停在u+d不过能够整除时:x取n*d/(u+d)+1,停在x*u-(n-x)*d#...
2018-05-26 17:42:33
168
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人