标签:tps == 链接 color 题解 hdu tput problem log
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12258409.html
偶数求和(98min)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2015
#include<stdio.h> #include<math.h> #include<stdlib.h> int main(void) { int n; int m; while(~scanf("%d %d",&n,&m)) { int c[100]={0}; int avg[100]={0}; int i; int j; int k; int t=0; c[0]=2; for(i=1;i<n;i++) { c[i]=c[i-1]+2; } for(j=0;j<n;j=j+m) { int sum=0; int mod=m; for(k=j;k<(m+j);k++) { sum=sum+c[k]; if(c[k]==0)
{ mod -=1; } } avg[t++]=sum/mod; } for(i=0;i<t-1;i++) printf("%d ",avg[i]); printf("%d",avg[t-1]); printf("\n"); } return 0; }
标签:tps == 链接 color 题解 hdu tput problem log
原文地址:https://www.cnblogs.com/ping2yingshi/p/12258409.html