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

对角线,注意n=1,e=1的情况就OK

Posted by TSERROF at 2012-08-08 17:44:23 on Problem 2101
#include <cstdio>
int main()
{
	int n,e;
	while(scanf("%d%d",&n,&e)!=EOF)
	{
		long long l=0,w=0,t;
		for (int i=1;i!=n;++i)
		{
			scanf("%lld",&t);
			l+=t;
		}
		for (int i=1;i!=e;++i)
		{
			scanf("%lld",&t);
			w+=t;
		}
		long long ans=0;
		while(ans*ans<l*l+w*w)++ans;
		printf("%lld\n",ans);
	}
	return 0;
}
当n=1,e=1的时候直接输出ans=0就ok了,这里wa了,⊙﹏⊙b汗

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