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
",L);
		else printf("2
");
	}
	return 0;
}
原文地址:https://www.cnblogs.com/zufezzt/p/6844950.html