当前位置:网站首页>[CCF CSP] 201709-1 dozen soy sauce
[CCF CSP] 201709-1 dozen soy sauce
2022-07-22 04:01:00 【Jenny, Jenny】
Problem description
Question number : | 201709-1 |
The title of the test question : | get some soy sauce |
The time limit : | 1.0s |
Memory limit : | 256.0MB |
Problem description : | Problem description Xiao Ming takes N Yuan to buy soy sauce . The soy sauce 10 A bottle for $1 , Business promotion , Every purchase 3 Bottle delivery 1 bottle , Or every time you buy 5 Bottle delivery 2 bottle . How many bottles of soy sauce can Xiao Ming get at most . Input format The first line of input contains an integer N, It means the amount of money Xiao Ming can use to buy soy sauce .N yes 10 Integer multiple ,N No more than 300. Output format Output an integer , It means how many bottles of soy sauce Xiao Ming can get at most . The sample input 40 Sample output 5 Sample explanation hold 40 Yuan divided into 30 Genna 10 element , Buy separately 3 Bottle and 1 bottle , among 3 Bottle delivery 1 bottle , Get... Together 5 bottle . The sample input 80 Sample output 11 Sample explanation hold 80 Yuan divided into 30 Genna 50 element , Buy separately 3 Bottle and 5 bottle , among 3 Bottle delivery 1 bottle ,5 Bottle delivery 2 bottle , Get... Together 11 bottle . |
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,res;
cin >> n;
res = (n / 50) * 7;
n %= 50;
res += (n / 30)*4 ;
n %= 30;
res += (n / 10);
cout << res;
return 0;
}
边栏推荐
猜你喜欢
蚂蚁安全实验室10篇论文被CCF-A类顶会收录,探索从算法角度实现AI可信
[CCF CSP] 201604-1 break point count
[39题] 牛客深度学习专项题
Scala函数的柯里化
When servlet writes webapp, filter interception is used to realize login verification
Chapter III after class exercises 15-23
Monai label installation process and use strategy
科创人·观远数据CEO苏春园:让业务用起来,是BI行业推倒渗透率之墙的关键
2.2 sequential representation of linear table
When idea creates a folder, the empty folder of the folder expands and overlaps
随机推荐
2020-2021新技术讲座课程
【CCF CSP】201812-1小明上学
并发编程之CountDownLatch,CyclicBarrier ,Semaphore
SATA协议OOB随笔
Web
xxl-job源码阅读笔记
做做C#
Natural language Processing in tensorflow quizs on Coursera
wireshark简单过滤规则
数据库原理及应用
gadget之udc
MysqlWorkBench性能分析工具--性能仪表盘
Shell编程基础及变量
The use of anonymous inner classes in development
【CCF CSP】201503-1图像旋转
shell运算符-数学运算,关系运算,字符串运算,文件检测运算
[CCF CSP] 201803-1 jump jump
TCL/TK分组和替换规则
Clean up SYSTEMd logs
gadget之composite