CodeForces 805A Fake NP
直觉。
一段区间中,肯定是$2$的倍数最多,因为区间长度除以$2$得到的数字最大。但只有$1$个数字的时候需要特判。
#include <cstdio>
#include <cmath>
#include <set>
#include <cstring>
#include <algorithm>
using namespace std;
int L,R;
int main()
{
while(~scanf("%d%d",&L,&R))
{
if(L==R) printf("%d\n",L);
else printf("2\n");
}
return 0;
}

浙公网安备 33010602011771号