标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1855 Accepted Submission(s): 1104
#include<stdio.h> #include<string.h> #define LL long long int main() { int w,d,n; int i; LL m,sum,ans; while(scanf("%d%d%d%lld",&n,&w,&d,&m)!=EOF) { sum=0; for(i=1;i<n;i++) sum+=i*w; ans=sum-m; if(ans==0) printf("%d\n",n); else printf("%lld\n",ans/d); } return 0; }
hdoj 2401 Baskets of Gold Coins
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4802967.html