您的位置:首页 > 编程语言 > Go语言

HDU 2401.Baskets of Gold Coins

2017-12-07 21:56 330 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2401

AC代码(C++):

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
#include <map>
#include <math.h>
#include <string>
#include <string.h>
#include <bitset>

#define INF 0xfffffff
#define MAXN 100105

using namespace std;

int n,w,d,x;

int main(){
while(scanf("%d%d%d%d",&n,&w,&d,&x)!=EOF){
int y = (n-1)*n*w/2-x;
if(y==0)cout<<n<<endl;
else cout<<y/d<<endl;
}
}

总结: 水题.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: