【Codeforces Round #421 (Div. 2) A】Mister B and Book Reading
2017-10-04 18:44
429 查看
【题目链接】:http://codeforces.com/contest/820/problem/A
【题意】
每天看书能看v页;
且这个v每天能增加a;
但是v有上限v1;
然后每天还必须往回看t页;
问你最少多少天能看完;
一共有c页;
【题解】
傻逼题.
【Number Of WA】
1
【反思】
在处理超过v1的时候没搞好.
【完整代码】
#include <bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long long #define rep1(i,a,b) for (int i = a;i <= b;i++) #define rep2(i,a,b) for (int i = a;i >= b;i--) #define mp make_pair #define pb push_back #define fi first #define se second #define ms(x,y) memset(x,y,sizeof x) #define Open() freopen("F:\\rush.txt","r",stdin) #define Close() ios::sync_with_stdio(0) typedef pair<int,int> pii; typedef pair<LL,LL> pll; const int dx[9] = {0,1,-1,0,0,-1,-1,1,1}; const int dy[9] = {0,0,0,-1,1,-1,1,-1,1}; const double pi = acos(-1.0); const int N = 110; LL c,v0,v1,a,l; void dfs(LL x,LL v,LL day){ if (x >= c){ cout << day << endl; return; } x-=l; LL temp = min(v1,v + a); dfs(x + temp,temp,day+1); } int main(){ //Open(); Close(); cin >> c >> v0 >> v1 >> a >> l; dfs(v0,v0,1); return 0; }
相关文章推荐
- Codeforces Round #421 (Div. 2) | A. Mister B and Book Reading
- Codeforces Round #421 (Div. 2) A. Mister B and Book Reading
- Codeforces Round #421 A. Mister B and Book Reading
- Mister B and Book Reading
- Mister B and Book Reading
- Codeforces Round #421 (Div. 2) C. Mister B and Boring Game
- CF#421 A. Mister B and Book Reading(模拟)
- CF820A-Mister B and Book Reading
- CF(#294 div2):D. A and B and Interesting Substrings
- B. Mister B and Angle in Polygon 421.div2
- CF #421 B. Mister B and Angle in Polygon
- 【CF819D】Mister B and Astronomers EXGCD
- Codeforces Round #294 (Div. 2) D. A and B and Interesting Substrings
- hash(Codeforces Round #294 (Div. 2)D. A and B and Interesting Substrings)
- 【codeforces】Round #294 (Div. 2) D. A and B and Interesting Substrings
- Codeforces Round #421 (Div. 2) | B. Mister B and Angle in Polygon
- Codeforces Round #421 (Div. 1):B. Mister B and PR Shifts 思维,乱搞
- 【CF819C】Mister B and Beacons on Field 数学
- Codeforces Round #294 (Div. 2) -- A. A and B and Chess
- Codeforces Round #294 (Div. 2) D. A and B and Interesting Substrings