#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
#define LL unsigned
int main()
{
LL n,l,r,m;
while(scanf("%u %u %u", &n, &l, &r) !=EOF)
{
int m = 0;
for( int i = 31; i >= 0; i--)
{
m += ( 1 << i);
if( m > r)
{
m -= (1 << i);
continue;
}
if( n &( 1 << i))
{
if( m >= l)
{
m -= (1 << i);
}
}
}
if ( m < l ) m = l;
printf( "%u\n", m );
}
}
UVA 10718
最新推荐文章于 2017-02-22 09:08:39 发布