直觉。

一段区间中,肯定是$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;
}

CodeForces 805A Fake NP的更多相关文章

  1. Codeforces Round #411 A. Fake NP

    A. Fake NP time limit per test   1 second memory limit per test   256 megabytes   Tavak and Seyyed a ...

  2. Codeforces 805A/B/C

    A. Fake NP 传送门:http://codeforces.com/contest/805/problem/A 本题是一个数学问题. 给定两个正整数l,r(l≤r),对于区间[l..r]上的任一 ...

  3. Codeforces805 A. Fake NP 2017-05-05 08:30 327人阅读 评论(0) 收藏

    A. Fake NP time limit per test 1 second memory limit per test 256 megabytes input standard input out ...

  4. Fake NP CodeForces - 805A (思维)

    Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following pro ...

  5. 【codeforces 805A】Fake NP

    [题目链接]:http://codeforces.com/contest/805/problem/A [题意] 问你在l..r这个区间内的所有数字: 对于每个数的因子; 出现次数最多的是哪一个; [题 ...

  6. Codeforces 802I Fake News (hard) (SA+单调栈) 或 SAM

    原文链接http://www.cnblogs.com/zhouzhendong/p/9026184.html 题目传送门 - Codeforces 802I 题意 求一个串中,所有本质不同子串的出现次 ...

  7. Codeforces 802I Fake News (hard)

    Codeforces 802I 题意:统计所有不同子串出现次数的平方的和. 想法:建一个SAM,$Ans=\sum (step[i]-step[fa[i]])*right[i]^2$ #include ...

  8. [codeforces 804F. Fake bullions]

    题目大意: 传送门. 给一个n个点的有向完全图(即任意两点有且仅有一条有向边). 每一个点上有$S_i$个人,开始时其中有些人有真金块,有些人没有金块.当时刻$i$时,若$u$到$v$有边,若$u$中 ...

  9. codeforces411div.2

    每日CF: 411div2 Solved A CodeForces 805A Fake NP Solved B CodeForces 805B 3-palindrome Solved C CodeFo ...

随机推荐

  1. 用shell获取目录/文件夹/文件的时间戳

    命令: date +%s -r 目录名/文件名 输出内容形如: 1276225332

  2. Code::Blocks之自动打开上次未关闭工作空间

    问题:如何设置Code::Blocks,使每次打开软件时,自动打开上次未关闭的工作空间? 设置(S) -> 环境设置...(E) -> 常规设置: 勾选"在程序启动时" ...

  3. CF544 C 背包 DP

    n个人写m行代码,第i人写一行代码有a[i]个bug,问总bug数不超过b的不同方案数. 其实就是个背包,dp[i][j][k]代表前i个人写了j行代码用了k个bug限度,然后随便转移一下就好了 /* ...

  4. TED_Topic2:My desperate journey with a human smuggler

    My desperate journey with a human smuggler By Barat Ali Batoor When I was a child there was a toy wh ...

  5. Paramiko使用

    1.下载安装 pycrypto-2.6.1.tar.gz (apt-get install python-dev) 解压,进入,python setup.py build[编译],python set ...

  6. Sublime之插件的安装(三)

    今天在写js的时候,突然想到一个问题就是能不能快速的对齐的插件,当当当~~~sublime这么神器当然有,那就是:Alignment插件 如果你写的代码是这样的: var a = , b =, ccc ...

  7. Python3中的SocketServer

    socket并不能多并发,只能支持一个用户,socketserver 简化了编写网络服务程序的任务,socketserver是socket的在封装.socketserver在python2中为Sock ...

  8. PHP文本式留言板——php经典实例

    文件结构: index.php 主页和添加页 show.php 查看留言页 ly.db 文本保存页 doAdd.php 添加功能页 doDel.php 删除功能页  index.php <htm ...

  9. 64_q1

    QMsgBox-0-9.20130830git94677dc.fc26.i686.rpm 13-Feb-2017 23:40 40674 QMsgBox-0-9.20130830git94677dc. ...

  10. Dev Express 安装

    Dev Express 安装 点击DevExpressUniversalTrialComplete-20151209.exe开始安装 选择需要安装的产品   选择需要安装的产品目录,这里设置为D盘 开 ...