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 suisui at 2009-10-19 00:17:37 on Problem 2309
In Reply To:仅供参考 Posted by:handle2 at 2009-08-07 12:09:31
我也贴一下

#include <iostream>
using namespace std;

int main()
{
	int queryCount = 0, root = 0;
	cin >> queryCount;
	while (queryCount -- > 0)
	{
		cin >> root;
		int d = root ^ (root | (root - 1));
		cout << root - d << ' ' << root + d << 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