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

Re:到底怎么错啊???高手们帮忙啊。难道我理解错了??还是。。。。。。。。。。。

Posted by beyonlin_SCUT at 2006-03-09 00:47:02 on Problem 2301
In Reply To:到底怎么错啊???高手们帮忙啊。难道我理解错了??还是。。。。。。。。。。。 Posted by:smilezhen at 2005-08-10 16:23:49
> #include <iostream.h>
> 
> int main(void){
> 	unsigned long long t, s, d;
> 	cin >> t;
> 	while(t--){
> 		cin>> s>>d;
> 		if(s<d)  cout<<"impossible"<<endl;
> 		else {
> 			if(s%2 ==0) cout <<(s/2+d/2)<<' '<<(s-d)/2<<endl;       <--- (s/2+d/2)<<应该为(s+d)/2,因为s和d可能同是奇数
> 			else cout <<((s-1)/2+(d+1)/2)<<' '<<(s-d)/2<< endl;
> 		}
> 	}
> 	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