CodeForces 402A
来源:互联网 发布:淘宝网店域名怎么改 编辑:程序博客网 时间:2024/05/20 22:36
没有读懂题意。为什么每次划分都要减去划分出去的因子?
原题链接:http://codeforces.com/problemset/problem/402/A
#include<iostream>#include<cstring>#include<cstdlib>#include<cstdio>#include<string>#include<map>#include<set>#include<algorithm>#include<vector>//#include<cmath>using namespace std;int main (){ int k,a,b,v; scanf ("%d%d%d%d",&k,&a,&b,&v); int time=0; while (a>0) {if (b+1>k){//因子b+1--能划分的数目,k--最多划分的数目 b=b-(k-1);//因子每次都要减划分出去的因子 a-=k*v;}else{ a-=(b+1)*v; b=0;}time++; } printf ("%d\n",time); return 0;}
0 0
- CodeForces 402A Nuts
- CodeForces 402A
- CodeForces 402A
- CodeForces-a
- 【Codeforces Round #402 (Div. 1)】Codeforces 778A String Game
- Codeforces 903A A
- codeforces 402B - Trees in a Row
- CodeForces 402A Nuts (二分)
- codeforces 402B Trees in a Row
- 【codeforces】Round #402 Div.2 A
- 【Codeforces-402A】-Pupils Redistribution(思维)
- Codeforces Round #402 (Div. 2) A+B
- Codeforces #402 (Div. 2) A. Pupils Redistribution
- Codeforces Round #402 (Div. 2) A题
- (贪心)Codeforces Round #402 A. Pupils Redistribution
- CodeForces 18A A - Triangle
- CodeForces 133A A. HQ9+
- codeforces 651A A. Joysticks
- top 25 论文
- Intersection (计算几何)
- 解题报告: 商品推荐走马灯
- log4j:WARN Please initialize the log4j system properly解决办法
- div、css入门练习
- CodeForces 402A
- FZU2184 逆序数还原
- 每天学习一点新东西——vim篇(二)
- Enum类型
- Zookeeper(一)安装
- C语言中的数组与指针的关系
- 函数返回引用的注意事项
- iOS第三天认识及了解注意
- LeetCode 合并k个有序链表