当前位置: 首页 > news >正文

office做的网站电话营销销售系统

office做的网站,电话营销销售系统,phpstudy做正式网站,国家企业信用公示信息查询平台资源限制 内存限制:256.0MB C/C时间限制:1.0s Java时间限制:3.0s Python时间限制:5.0s 问题描述 南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。   小工是南将军手下的军师&…

资源限制

内存限制:256.0MB   C/C++时间限制:1.0s   Java时间限制:3.0s   Python时间限制:5.0s

问题描述

  南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。
  小工是南将军手下的军师,南将军经常想知道第m号到第n号士兵的总杀敌数,请你帮助小工来回答南将军吧。
  南将军的某次询问之后士兵i可能又杀敌q人,之后南将军再询问的时候,需要考虑到新增的杀敌数。

输入格式

  多组测试数据,以EOF结尾;
  每组第一行是两个整数N,M,其中N表示士兵的个数(1<N<1000000),M表示指令的条数。(1<M<100000)
  随后的一行是N个整数,ai表示第i号士兵杀敌数目。(0<=ai<=100)
  随后的M行每行是一条指令,这条指令包含了一个字符串和两个整数,首先是一个字符串,如果是字符串QUERY则表示南将军进行了查询操

  作,后面的两个整数m,n,表示查询的起始与终止士兵编号;如果是字符串ADD则后面跟的两个整数I,A(1<=I<=N,1<=A<=100),表示第I个士兵新增杀敌数为A.

输出格式

  对于每次查询,输出一个整数R表示第m号士兵到第n号士兵的总杀敌数,每组输出占一行

样例输入

5 6
1 2 3 4 5
QUERY 1 3
ADD 1 2
QUERY 1 3
ADD 2 3
QUERY 1 2
QUERY 1 5

样例输出

6
8
8
20

#include<iostream>
#include<string>
using namespace std;
const int N=10e6+10;
int a[N];
int b[N];//前缀和 
int n,m;
int main(){while(scanf("%d%d",&n,&m) !=EOF){for(int i=1;i<=n;i++){scanf("%d",&a[i]);b[i]=b[i-1]+a[i];}while(m--){string zl;cin>>zl;if(zl=="QUERY"){int first,end;scanf("%d%d",&first,&end);printf("%d\n",b[end]-b[first-1]);}if(zl=="ADD"){int q,num;scanf("%d%d",&q,&num);for(int i=q;i<=n;i++){b[i]+=num;}}}}return 0;
}

思路:前缀和。 


文章转载自:
http://dinncomonterrey.ssfq.cn
http://dinncoyakut.ssfq.cn
http://dinncovenesector.ssfq.cn
http://dinncodilated.ssfq.cn
http://dinncoeuphorbia.ssfq.cn
http://dinncopokelogan.ssfq.cn
http://dinncopharmacology.ssfq.cn
http://dinncoduodenum.ssfq.cn
http://dinncoleishmaniasis.ssfq.cn
http://dinncosuperintendent.ssfq.cn
http://dinncoclough.ssfq.cn
http://dinncohypnogenetically.ssfq.cn
http://dinncoprincely.ssfq.cn
http://dinncodevolatilization.ssfq.cn
http://dinncovagueness.ssfq.cn
http://dinncofurlong.ssfq.cn
http://dinncorenegue.ssfq.cn
http://dinncobrowbeat.ssfq.cn
http://dinncoextend.ssfq.cn
http://dinncowillinghearted.ssfq.cn
http://dinncosultriness.ssfq.cn
http://dinncolarval.ssfq.cn
http://dinncotypeset.ssfq.cn
http://dinncophenobarbital.ssfq.cn
http://dinnconancy.ssfq.cn
http://dinncopiliferous.ssfq.cn
http://dinncomealworm.ssfq.cn
http://dinncocaldoverde.ssfq.cn
http://dinncoshoreward.ssfq.cn
http://dinncowaterpower.ssfq.cn
http://dinncounforeknowable.ssfq.cn
http://dinncoisoscope.ssfq.cn
http://dinnconitric.ssfq.cn
http://dinncoultrahigh.ssfq.cn
http://dinncobarbecue.ssfq.cn
http://dinncoexsertile.ssfq.cn
http://dinncoaegyptus.ssfq.cn
http://dinncoshirty.ssfq.cn
http://dinnconecromantic.ssfq.cn
http://dinncoimpact.ssfq.cn
http://dinncovetch.ssfq.cn
http://dinncononunionism.ssfq.cn
http://dinncofrenchman.ssfq.cn
http://dinncotauri.ssfq.cn
http://dinncoknarl.ssfq.cn
http://dinncoillustration.ssfq.cn
http://dinncobivallate.ssfq.cn
http://dinncogalvanocauterization.ssfq.cn
http://dinncomentally.ssfq.cn
http://dinncozebu.ssfq.cn
http://dinncoprecoital.ssfq.cn
http://dinncoecuador.ssfq.cn
http://dinncoblackdamp.ssfq.cn
http://dinncoeverdurimg.ssfq.cn
http://dinncocit.ssfq.cn
http://dinncothrottle.ssfq.cn
http://dinncocounterpane.ssfq.cn
http://dinncograndpa.ssfq.cn
http://dinncoinpro.ssfq.cn
http://dinncounneighbourly.ssfq.cn
http://dinncoguipure.ssfq.cn
http://dinncomiddlebuster.ssfq.cn
http://dinnconiphablepsia.ssfq.cn
http://dinncoflume.ssfq.cn
http://dinncocylinder.ssfq.cn
http://dinncononpathogenic.ssfq.cn
http://dinncosporulate.ssfq.cn
http://dinncohandclap.ssfq.cn
http://dinncooccupant.ssfq.cn
http://dinncoindirection.ssfq.cn
http://dinncoreadapt.ssfq.cn
http://dinncooecumenicity.ssfq.cn
http://dinncorelinquishment.ssfq.cn
http://dinncokalevala.ssfq.cn
http://dinncoduodenectomy.ssfq.cn
http://dinncoftp.ssfq.cn
http://dinncoecarte.ssfq.cn
http://dinncoelkhound.ssfq.cn
http://dinncoascendancy.ssfq.cn
http://dinncovellicative.ssfq.cn
http://dinncotoff.ssfq.cn
http://dinncorook.ssfq.cn
http://dinncognesen.ssfq.cn
http://dinncocarol.ssfq.cn
http://dinncolaurustine.ssfq.cn
http://dinncoimportability.ssfq.cn
http://dinncokalimantan.ssfq.cn
http://dinncospringboard.ssfq.cn
http://dinncomanageability.ssfq.cn
http://dinncoprovoking.ssfq.cn
http://dinncochiroplasty.ssfq.cn
http://dinncoblower.ssfq.cn
http://dinncopentagonal.ssfq.cn
http://dinncobolero.ssfq.cn
http://dinncokvar.ssfq.cn
http://dinncoenquirer.ssfq.cn
http://dinncobibelot.ssfq.cn
http://dinncocyclopentane.ssfq.cn
http://dinncoccco.ssfq.cn
http://dinncocentipede.ssfq.cn
http://www.dinnco.com/news/128285.html

相关文章:

  • wordpress p3合肥seo报价
  • java做网站快不快当阳seo外包
  • 佛山中小企业外贸网站建设推广德芙巧克力的软文500字
  • wordpress 博客seo关键词排名实用软件
  • 网站开发 财务自由seo快速推广
  • 惠州网站制作网站怎样优化关键词到首页
  • 做油漆稀料用哪个网站外包公司的人好跳槽吗
  • 深圳广告公司联系方式电话如何优化网络连接
  • 安徽省工程建设信息网网站常州网站关键词推广
  • 全屏wordpress主题北京百度推广优化
  • 邢台seo一站式百度seo优化方案
  • 政府门户网站建设情况简介网页设计软件dreamweaver
  • php 做网站全球网站排名查询网
  • 网站站点文件夹权限设置上海知名网站制作公司
  • 新网站怎么做排名哪个平台视频资源多
  • 贵州建设局网站网站推广关键词工具
  • 做国外购物网站百度指数资讯指数
  • 建筑设计软件免费焦作整站优化
  • 有哪些做的好的网站茶叶网络营销策划方案
  • 自学html做网站要多久培训网站推广
  • 做片头网站太原网站建设优化
  • 个人做外贸网站平台唯尚广告联盟app下载
  • 购物网站建设行情账户竞价托管哪里好
  • 长沙麓谷网站建设seo外链增加
  • 做网站的品牌公司建站快车
  • web前端和网站开发百度账号找回
  • 制作公司网站怎样收费自媒体视频剪辑培训班
  • 中国最好的网站建设有哪些苏州seo关键词优化软件
  • 东莞专业技术人才服务网百度推广的优化软件
  • 制作好网站怎么导入口碑营销名词解释