acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 第一个题解

    #include<iostream> using namespace std; int main(){ int x,n,sum=0; cin>>x; cin>>n; int b=x; for(int i=1;i<=n;i++){ int a; cin>>a; if(a<=b){ b=x; b+=a; sum++; }else{ break; } } cout<<sum; return 0; }

    userId_undefined
    人机猫
    出道萌新时空双修者倔强青铜GESP4级维度操控者快乐小狗
    53阅读
    0回复
    1点赞
  • 题解

    userId_undefined
    ???
    题解仙人时空双修者字符串·魔法使出道萌新GESP3级模拟·模拟练习生
    22阅读
    0回复
    3点赞
  • AC代码

    #include<bits/stdc++.h> using namespace std; int x,n,a[510]={0},s,e; int main(){ cin>>x>>n; for(int i=0;i<n;i++){ cin>>a[i]; }for(int i=0;i<n;i++){ e=a[i]-a[i-1]; if(e<x){ s++; } }cout<<s; return 0; }

    userId_undefined
    谢羽笑
    7阅读
    0回复
    1点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页