地址:http://acm.uestc.edu.cn/#/problem/show/1558

题目:

D - Destr0y City

Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)

Alice want to build nn cities on a plane. A city can be regarded as a point. In order to keep communication between cities, the distance between each pair of cities must NOT greater than DD.

Bob has a weapon which can destroy all the cities in a circle with radius RR. After Alice building all the cities, Bob will select a city as the center and use his weapon once, and he will choose a way such that can destroy as many cities as possible.

To prevent the cities from being destroyed, Alice want choose a way to build her cities such that the number of cities will be destroyed by Bob can be as little as possible, can you tell her how to build these cities?

In order to make the problem easier, you can assume that D=2√RD=2R is always established, so the specific values of DD and RR will not affect the answer.

Input

Only one line contains an integer nn.

1≤n≤10181≤n≤1018.

Output

The number of cities will be destroyed by Bob if Alice choose the optimal scheme to build her cities.

Sample input and output

Sample Input Sample Output
3
1

思路:找规律,猜结论

 #include<iostream>
using namespace std;
long long n;
int main()
{
cin>>n;
cout<<n/+!(!(n%));
}

最新文章

  1. Matrix Admin 后台模板笔记
  2. [LintCode] Letter Combinations of a Phone Number 电话号码的字母组合
  3. 【Linux】文件特殊权限 SUID/SGID/Sticky Bit
  4. maven--composer---setting.xml(updatepolicy)---mvn install , mvn deploy
  5. 实现Android半透明Menu效果的开发实例
  6. 手把手教你反编译别人的app
  7. 设计模式 Template Method模式 显示程序猿的一天
  8. 【优先队列】-HDU4546比赛难度
  9. linux面试
  10. 手机电话号码吉凶查询原理及ASP算法源码 转
  11. 013 session_flush
  12. 移动端 上传头像 并裁剪功能(h5)
  13. CFile、CStdioFile、FILE和其他文件操作(转+总结)
  14. navicat 定时备份
  15. gitlab webhook php exec 调用 shell 脚本。shell 脚本中调用 git pull 命令无法执行。
  16. 如何让IE 低版本下支持 css3属性
  17. FFTW3学习笔记3:FFTW 和 CUFFT 的使用对比
  18. AIDL 简单实现
  19. 【Splay】洛谷3372 【模板】线段树 1
  20. 好的web前端是如何拿到30万年薪的?

热门文章

  1. Docker 使用及常用命令
  2. Entity Framework 学习建议及教学PPT
  3. 第1章 部署虚拟环境安装linux系统
  4. [Android] 开源框架 Volley 自定义 Request
  5. [SharePoint 2010] Visual Studio 2010內撰寫視覺化WebPart超簡單
  6. HDFS编程
  7. Yii2.0在GridView中下拉过滤筛选的实现
  8. synchronized和volatile的使用方法以及区别
  9. java面试基础题------》Java 中的父子类静态代码块,代码块,构造方法执行顺序
  10. 8个Javascript小技巧