刷题统计c++实现

cpp 复制代码
#include<iostream>
using namespace std;
long long int a,b,n;

int main(){
    cin>>a>>b>>n;
    long long int res = 0;
    res += (n/(a*5+b*2)==0)?0:(n/(a*5+b*2))*7;
    n %= a*5+b*2;
    while(n>0){
        if(res % 7 <5) n -= a;
        else n -= b;
        res++;
    }
    cout<<res<<endl;
}
相关推荐
2601_956121974 小时前
背包基础篇(01、完全、分组、多重、混合)
c++·算法·动态规划
丰锋ff4 小时前
基于 Qt 的智能门禁系统(二)
开发语言·qt
fpcc4 小时前
跟我学C++中级篇——编译期的条件选择
开发语言·c++
SomeB1oody4 小时前
【RustyML入门】6.3. 并行归约
开发语言·后端·机器学习·rust·教程
兴通物联科技5 小时前
SMT PCB 微小 DataMatrix 码扫不动问题分析 兴通 XT8601B 600 万像素工业读码器落地实践
大数据·人工智能·单片机·嵌入式硬件·算法·计算机视觉
mqiqe5 小时前
AgentScope Java 2.0 协议集成全景解析:A2A、AG-UI、Agent Protocol 三大开放协议实战指南
java·开发语言·ui
lzhdim5 小时前
12、JavaScript常见的内存泄露问题 - JavaScript学习系列文章
开发语言·前端·javascript·学习·ecmascript
脉动数据行情6 小时前
Java 实现台股 TWSE/TPEx 行情采集(个股 + K 线)
java·开发语言·twse·tpex·台股
爱学习的小邓同学6 小时前
Golang --- (1)第一个Golang程序
开发语言·后端·golang