[CF1065A]Vasya and Chocolate
题目大意:有$s$元,一个物品$c$元,每买$a$个就送$b$个,问一共可以买多少。
题解:全部买好,最后看可以送多少(其实是因为我这道题交错了,无聊才做的)
卡点:无
C++ Code:
#include <cstdio>
int Tim;
int main() {
scanf("%d", &Tim);
while (Tim --> 0) {
long long s, a, b, c;
scanf("%lld%lld%lld%lld", &s, &a, &b, &c);
long long tmp = s / c;
tmp += tmp / a * b;
printf("%lld\n", tmp);
}
return 0;
}
[CF1065A]Vasya and Chocolate的更多相关文章
- CF1065A Vasya and Chocolate 题解
Content 小 V 有 \(s\) 块钱,商店里有巧克力卖,每块巧克力 \(c\) 块钱,现在商店给出优惠:购买 \(a\) 块巧克力可以免费获得 \(b\) 块巧克力,求小 V 最多能够买到的巧 ...
- A. Vasya and Chocolate
链接 [http://codeforces.com/contest/1065/problem/A] 分析 一个公式完事 代码 #include<bits/stdc++.h> using n ...
- Educational Codeforces Round 52 (Rated for Div. 2)
题目链接 A. Vasya and Chocolate 题意 已知钱,价格,赠送规则求最多获得巧克力数 思路常规算即可 代码 #include <bits/stdc++.h> #defin ...
- [CodeForces]Educational Round 52
幸好我没有打这场,我VP的时候在C题就卡死了,我果然还是太菜了. A Vasya and Chocolate 题意:一个巧克力\(c\)元,买\(a\)赠\(b\),一共有\(n\)元,问能买几个巧克 ...
- Codeforces Edu Round 52 A-E
A. Vasya and Chocolate 模拟题.数据会爆\(int\),要开\(long\) \(long\) #include <iostream> #include <cs ...
- Milliard Vasya's Function-Ural1353动态规划
Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make ...
- CF460 A. Vasya and Socks
A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Big Chocolate
Big Chocolate 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=19127 Big Chocolat ...
- Dividing a Chocolate(zoj 2705)
Dividing a Chocolate zoj 2705 递推,找规律的题目: 具体思路见:http://blog.csdn.net/u010770930/article/details/97693 ...
随机推荐
- p标签内不能含有块元素。
原来一直听网上这样说.自己并没有实际遇到过.上例子. <!DOCTYPE html> <html> <head> <meta charset="ut ...
- C# 多条件拼接sql
#region 多条件搜索时,使用List集合来拼接条件(拼接Sql) StringBuilder sql = new StringBuilder("select * from PhoneN ...
- 电子商城实录------定义init初始化的方法
路由方法的设置 //路由方法 private static function dispatch(){ //获取控制器名称(类比:英文单词的后缀) $controller_name=CONTROLLER ...
- Hadoop(14)-MapReduce框架原理-切片机制
1.FileInputFormat切片机制 切片机制 比如一个文件夹下有5个小文件,切片时会切5个片,而不是一个片 案例分析 2.FileInputFormat切片大小的参数配置 源码中计算切片大小的 ...
- elasticsearch 5.x 系列之三 mapping 映射的时候的各个字段的设置
首先看来创建一个mapping 来show show: curl -XPUT "master:9200/zebra_info?pretty" -H 'Content-Type: a ...
- elasticsearch 5.x 系列之四(索引模板的使用,详细得不要不要的)
1,首先看一下下面这个索引模板 curl -XPUT "master:9200/_template/template_1?pretty" -H 'Content-Type: app ...
- Python变量和循环
1.Python变量 比C语言,Java语言更加简洁,不需要加int等等类型定义,直接变量名 = 值,Python里甚至不需要分号.有些特定的不能当做变量名,变量只能由字母.数字和下划线组成,下划线可 ...
- 自己动手编写 Dockerfile 构建自定义的Jenkins
1.构建jenkins 镜像 vim Dockerfile FROM jenkins USER root ARG dockerGid=999 RUN echo "docker:x:${d ...
- Go搭建一个Web服务器
package main import ( "fmt" "net/http" "strings" "log" ) fun ...
- 「LibreOJ#515」贪心只能过样例 (暴力+bitset)
可以发现,答案最大值只有106,于是想到用暴力维护 可以用bitset合并方案可以优化复杂度, Code #include <cstdio> #include <bitset> ...