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;
}
CodeForces 805A Fake NP的更多相关文章
- 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 ...
- Codeforces 805A/B/C
A. Fake NP 传送门:http://codeforces.com/contest/805/problem/A 本题是一个数学问题. 给定两个正整数l,r(l≤r),对于区间[l..r]上的任一 ...
- 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 ...
- Fake NP CodeForces - 805A (思维)
Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following pro ...
- 【codeforces 805A】Fake NP
[题目链接]:http://codeforces.com/contest/805/problem/A [题意] 问你在l..r这个区间内的所有数字: 对于每个数的因子; 出现次数最多的是哪一个; [题 ...
- Codeforces 802I Fake News (hard) (SA+单调栈) 或 SAM
原文链接http://www.cnblogs.com/zhouzhendong/p/9026184.html 题目传送门 - Codeforces 802I 题意 求一个串中,所有本质不同子串的出现次 ...
- Codeforces 802I Fake News (hard)
Codeforces 802I 题意:统计所有不同子串出现次数的平方的和. 想法:建一个SAM,$Ans=\sum (step[i]-step[fa[i]])*right[i]^2$ #include ...
- [codeforces 804F. Fake bullions]
题目大意: 传送门. 给一个n个点的有向完全图(即任意两点有且仅有一条有向边). 每一个点上有$S_i$个人,开始时其中有些人有真金块,有些人没有金块.当时刻$i$时,若$u$到$v$有边,若$u$中 ...
- codeforces411div.2
每日CF: 411div2 Solved A CodeForces 805A Fake NP Solved B CodeForces 805B 3-palindrome Solved C CodeFo ...
随机推荐
- 2017北京国庆刷题Day6 afternoon
期望得分:100+100+40=240 实际得分:100+0+40=140 二进制拆分.二进制前缀和 #include<cstdio> #include<iostream> u ...
- SSM框架使用-wrong
mybatis手册 1. mybatis 绑定错误 如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement ...
- JVM调优总结(4):分代垃圾回收
为什么要分代 分代的垃圾回收策略,是基于这样一个事实:不同的对象的生命周期是不一样的.因此,不同生命周期的对象可以采取不同的收集方式,以便提高回收效率. 在Java程序运行的过程中,会产生大量的对象, ...
- MongoDB - MongoDB CRUD Operations, Update Documents
Update Methods MongoDB provides the following methods for updating documents in a collection: Method ...
- MongoDB - MongoDB CRUD Operations, Query Documents, Query for Null or Missing Fields
Different query operators in MongoDB treat null values differently. The examples on this page use th ...
- 无聊js画了个菱形
function repeat(str, count) { return count < 0 ? '' : (new Array(count)).join(str); } function di ...
- Cloudera 安装
参考网址: http://tcxiang.iteye.com/blog/2087597 http://archive.cloudera.com/cdh5/ http://archive.clouder ...
- 【BZOJ3745】Norma [分治]
Norma Time Limit: 20 Sec Memory Limit: 64 MB[Submit][Status][Discuss] Description Input 第1行,一个整数N: ...
- 【BZOJ】3039: 玉蟾宫 悬线法
[题意]给定01矩阵,求最大全1子矩阵.n,m<=1000. [算法]动态规划(悬线法) [题解]★对于01矩阵中的任意一个全1极大子矩阵,都可以在其上边界遇到的障碍点处悬线到下边界的点x,则点 ...
- datagrid导出数据
//导出excel public function touzi_doExport() { $search=$_POST['search']; //接受前端传过来的数据 $this->succes ...