Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

超短的0MS的代码

Posted by zhouzhendong at 2017-02-26 11:39:59 on Problem 2393
#include <cstdio>
typedef long long ll;
struct AC{
	ll c,y;
}r[11000];
ll n,s;
int main(){
	scanf("%d%d",&n,&s);
	for (int i=1;i<=n;i++)
		scanf("%d%d",&r[i].c,&r[i].y);
	ll ans=0,min=1<<30;
	for (int i=1;i<=n;i++){
		min+=s;
		if (min>r[i].c)
			min=r[i].c;
		ans+=min*r[i].y;
	}
	printf("%lld",ans);
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator