codeforces round #236 div.2 A
来源:互联网 发布:面试题php了解多少 编辑:程序博客网 时间:2024/05/01 00:36
题目链接:http://codeforces.com/contest/402/problem/A
第一次做codeforces。第一道水题,没什么算法,直接贴代码。
///2014.3.16///codeforces round #236 div.2///A#include <cstdio>#include <iostream>using namespace std;int main(){ int k,a,b,v; scanf("%d%d%d%d",&k,&a,&b,&v); int n = 0; while( a>0 ){ if( b>=k-1 ){ b -= k-1; a -= k*v; n++; } else if( b>0 ){ a -= (b+1)*v; b = 0; n++; } else{ a -= v; n++; } } printf("%d",n ); return 0;}
0 0
- Codeforces Round #236 (Div. 2) A. Nuts
- Codeforces Round #236 (Div. 2)A
- Codeforces round #236Div.2--A;B
- Codeforces Round #236 (Div. 2) A. Nuts
- Codeforces Round #236 (Div. 2)------A,B
- codeforces round #236 div.2 A
- codeforces Round #236(DIV 2)A. Nuts
- Codeforces Round #236 (Div. 2) B. Trees in a Row
- codeforces Round # 236(DIV 2)B. Trees in a Row
- Codeforces Round #236 (Div. 2)__Trees in a Row
- Codeforces Round #236 (Div. 2) B. Trees in a Row
- Codeforces Round #236 (Div. 2)A(贪心、数学)
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #174 (Div. 2) Problem A
- Codeforces Round #173 (Div. 2) A.Bit++
- Codeforces Round #181 (Div. 2) A题
- Codeforces Round #184 (Div. 2) A题
- Codeforces Round #185 (Div. 2)--A,B
- HDU--1052
- win8下更改codeblocks颜色
- java验证码
- poj1230 Pass-Muraille 贪心算法,形成良好的代码风格很重要
- 协同过滤算法
- codeforces round #236 div.2 A
- Java学习笔记_14_switch、continue、break执行语句要点
- hibernate的继承关系映射(一)
- 人在旅途
- mapreduce实现reduce端表关联
- 第六章作业part2
- awk 正则表达式
- codeforces round #236 div.2 B
- android listview 属性介绍