我是靠谱客的博主 平常嚓茶,这篇文章主要介绍cf 11a Increasing Sequence,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream> #include <cstdio> using namespace std; #define LL long long #define ULL unsigned long long int 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("%I64dn",ans); return 0; }

最后

以上就是平常嚓茶最近收集整理的关于cf 11a Increasing Sequence的全部内容,更多相关cf内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(64)

评论列表共有 0 条评论

立即
投稿
返回
顶部