当前位置:网站首页>试题 C: 刷题统计
试题 C: 刷题统计
2022-07-20 05:29:00 【冷颕】
【问题描述】 小明决定从下周一开始努力刷题准备蓝桥杯竞赛。他计划周一至周五每天 做 a 道题目,周六和周日每天做 b 道题目。请你帮小明计算,按照计划他将在 第几天实现做题数大于等于 n 题?
【输入格式】 输入一行包含三个整数 a, b 和 n.
【输出格式】 输出一个整数代表天数。
【样例输入】 10 20 99
【样例输出】 8
【评测用例规模与约定】 对于 50% 的评测用例,1 ≤ a, b, n ≤ 10^6 . 对于 100% 的评测用例,1 ≤ a, b, n ≤ 10^18
#include<iostream>
using namespace std;
int main()
{
int date1=0;
long long a,b,n;
cin>>a>>b>>n;
while (n>0)
{
for(int i=1;i<=5;i++)
{
if(n<=0)
{
break;
}
n=n-a;
date1++;
}
for(int i=6;i<=7;i++)
{
if(n<=10)
{
break;;
}
n=n-b;
date1++;
}
}
cout<<date1<<endl;
return 0;
}
边栏推荐
- Apache Doris ODBC Mysql外表在Ubuntu下使用方法及配置
- Leetcode 200 Number of islands (July 19, 2022)
- DOM -- event syntax
- ES6新增二(字符串,数组)
- Automatic saving function in LabVIEW
- Fragment APIs are obsolete. Are you still using them?
- TASK02|EDA初体验
- 30 spark introduction: Spark Technology stack explanation, partition, system architecture, operator and task submission method
- Mysql 我随手造200W条数据,给你们讲讲分页优化。
- Ctfshow web entry information collection WP (1-20) (detailed explanation)
猜你喜欢
TASK02|EDA初体验
Deep learning 2-linear unit and gradient descent
CVPR 2020 | Social-STGCNN:基于图卷积的行人轨迹预测
牛客BM6 判断链表中是否有环
Implementation of fruit and vegetable mall management system based on SSM
一文了解 NebulaGraph 上的 Spark 项目
DNS域名解析过程剖析
【科学文献计量】中英文文献标题及摘要分词字数与频数统计与可视化
Win10 builds Presto development environment based on idea
win10如何实现电脑上文件共享访问
随机推荐
Apache Doris connects to SQL server through ODBC
Constructeur de liste STL, taille
MATLAB数字图像处理 实验五:形态学图像处理
Binary tree implementation (generate binary tree according to hierarchical array)
[wechat applet] text field input with maximum word limit (1/100)
STL list构造函数、大小
Circuit board debugging
Event object of DOM
J9 Digital Platform Theory: the possibilities and limitations of defi in the metauniverse
ModuleNotFoundError: No module named ‘PyEMD‘ 解决方法
Asynchronous processing of readfile blocking
Apache Doris uses the Prometheus alertmanager module to send exception information to the nail alarm group
ES6新增二(字符串,数组)
Usage and examples of Apache Doris binlog load
Towards Representation Alignment and Uniformity in Collaborative Filtering
Dictionary preface - company naming
C语言函数作业
力扣(LeetCode)200. 岛屿数量(2022.07.19)
DOM -- event syntax
记笔记之Hal库串口