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 |
lowbit水过+1#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); int N; cin >> N; for (int i = 0; i < N; i++) { int x; cin >> x; int lowbit = x & -x; cout << (x - lowbit + 1) << ' ' << (x + lowbit - 1) << '\n'; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator