Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
暴力 只比较 最近一周的#include<iostream> using namespace std; const int N = 10003; int main() { __int64 asn=0,min; int n,s,i; int c[N],y[N]; cin>>n>>s; for( i=0;i<n;i++) { cin>>c[i]>>y[i]; } for(i=1;i<n;i++) { min=0; if(c[i-1]+s<c[i]) min=(c[i-1]+s)*y[i]; else min = c[i]*y[i]; asn+=min; } printf("%I64d\n",asn+c[0]*y[0]); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator