cf 11a Increasing Sequence
来源:互联网 发布:模拟退火和遗传算法 编辑:程序博客网 时间:2024/05/22 01:38
#include <iostream>#include <cstdio>using namespace std;#define LL long long#define ULL unsigned long longint main(){ int n,d; ULL ans=0; LL b[2005]; scanf("%d%d",&n,&d); for(int i=0;i<n;i++) scanf("%I64d",&b[i]); for(int i=1;i<n;i++) if(b[i]<=b[i-1]) { if(b[i]==b[i-1]) { ans+=1; b[i]+=d; } else { int tmp=(b[i-1]-b[i])/d+1; ans+=tmp; b[i]+=tmp*d; } } printf("%I64d\n",ans); return 0;}
0 0
- cf 11a Increasing Sequence
- 11A - Increasing Sequence
- CodeForces - 11A Increasing Sequence
- codeforces 11A - Increasing Sequence
- CodeForces 11A - Increasing Sequence
- 【水贪心】#11 A. Increasing Sequence
- Codeforces Beta Round #11 A. Increasing Sequence
- A. Increasing Sequence
- A. Increasing Sequence
- Codeforces Beta Round #11 A. Increasing Sequence 贪心
- CF 223A Bracket Sequence
- CF - 223 - A. Bracket Sequence
- Increasing Sequence
- 【CF】CodeForces 301A Yaroslav and Sequence
- 1203: Super-increasing sequence
- 1207: Strictly-increasing sequence
- Super-increasing sequence
- CSU1207(Strictly-increasing sequence)
- 日记
- CUDA C 最精简的标准格式
- POJ 1015 Jury Compromise
- perl中数组的定义和使用
- 基于j2ee+matlab的尝试
- cf 11a Increasing Sequence
- eclipse转MyEclipse
- 关于委托与自定义事件EventArgs浅谈
- Android:带你玩转Servie,子线程,与UI线程通信[导入导出]
- 【Android成长之路】Intent初体验—使用Intent 在活动之间穿梭(一)
- cf 12a Super Agent
- [POJ 3169]Layout[差分约束][最短路]
- POJ 1458 Common Subsequence
- Android 深入了解 Handler 和 Looper