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 |
对角线,注意n=1,e=1的情况就OK#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator