地址: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


思路:找规律,猜结论

1 #include<iostream>
2 using namespace std;
3 long long n;
4 int main()
5 {
6    cin>>n;
7    cout<<n/3+!(!(n%3));
8 }

转载于:https://www.cnblogs.com/weeping/p/6632187.html

The 15th UESTC Programming Contest Preliminary D - Destr0y City cdoj1558相关推荐

  1. The 15th UESTC Programming Contest Preliminary C - C0ins cdoj1554

    地址:http://acm.uestc.edu.cn/#/problem/show/1554 题目: C0ins Time Limit: 3000/1000MS (Java/Others)     M ...

  2. The 15th UESTC Programming Contest Preliminary K - Kidd1ng Me? cdoj1565

    地址:http://acm.uestc.edu.cn/#/problem/show/1565 题目: Kidd1ng Me? Time Limit: 3000/1000MS (Java/Others) ...

  3. The 15th UESTC Programming Contest Preliminary H - Hesty Str1ng cdoj1551

    地址:http://acm.uestc.edu.cn/#/problem/show/1551 题目: Hesty Str1ng Time Limit: 3000/1000MS (Java/Others ...

  4. (趋势)The 2002 Trend Micro Programming Contest, Preliminary

    The 2002 Trend Micro Programming Contest, Preliminary 蕷B氡呂?  蘥?╂賓Y?   Good Neighbors a???6摕   圓2d:&a ...

  5. the 12th UESTC Programming Contest Final Justice is Given by Light (几何+ 二分)

    题目来源: http://acm.uestc.edu.cn/#/problem/show/814 题意:是给你一堆凸包上的点,这些点会形成一个凸多边形,有两个god站在这个多边形上,他们可以释放一个半 ...

  6. The 9th UESTC Programming Contest Warmup 1 A B D E

    出了4题,rank 37 A ,水题,看字符串里有多少个TTT, TTH, THT, THH, HTT, HTH, HHT and HHH 1A #include <queue> #inc ...

  7. The 15th Jilin Provincial Collegiate Programming Contest

    The 15th Jilin Provincial Collegiate Programming Contest A. Random Number Checker 签到 #include <bi ...

  8. Sichuan University Programming Contest 2018 Preliminary

    嗯为了防止大家AK,所以这次的A题和K题我们就当做不存在好了! 经历了昨天写了两个多小时的博客没保存的心态炸裂,今天终于下了个Markdown.所以我猜这篇的格式应该会更好看一点! 好吧废话不多说 题 ...

  9. The 15th Heilongjiang Provincial Collegiate Programming Contest题解 gym102803

    The 15th Heilongjiang Provincial Collegiate Programming Contest题解 gym102803 前言 题目 A. August B. Bills ...

最新文章

  1. C# 窗体位置 Show和ShowDialog (转载)
  2. 还搞不懂 Java NIO?快来读读这篇文章!
  3. css 联系我们,CSS3 模态窗口联系我们表单模板
  4. 升级 90天 vs2008 在win2008下。
  5. 前端开发这么多年,你真的了解浏览器页面渲染机制吗?
  6. CF 295A - Greg and Array 差分數列
  7. php生成appid,PHP生成腾讯云COS签名
  8. jar注册成服务器,Spring Boot项目生成jar包,并在windows服务器中注册成服务,开机启动(示例代码)...
  9. Linux网络:Virtual Routing and Forwarding (VRF)
  10. 【Spark篇】---Spark调优之代码调优,数据本地化调优,内存调优,SparkShuffle调优,Executor的堆外内存调优...
  11. 2017杭州云栖大会FAQ(持续更新中)
  12. 自学python3 最好的入门书籍-清华学霸整理,Python入门到精通这几本书帮你快速入行...
  13. clion连接mysql,使用 CLion 调试 mysql 源码
  14. 学习fortran77基础语法
  15. PXE-E61: Media test failure, check cable PXE-M0F: Exiting Intel Boot Agent. 解决方法
  16. 怎样将pdf格式转换成jpg
  17. 通过Dockerfile创建docker镜像
  18. html导航页面转换,纯CSS实现导航栏Tab切换效果
  19. 【RF】Receiver Function接收函数
  20. checkbox wpf 背景图片_WPF的CheckBox样式总结

热门文章

  1. POJ 1054 The Troublesome Frog(枚举 + 剪枝)
  2. 视频数据训练太慢?试试UT-AustinFAIR提出的多重网格训练,加速4.5倍,还能提点!...
  3. 从数据到模型:实现自动驾驶高效感知
  4. CVPR2021 最佳论文候选—提高图像风格迁移的鲁棒性
  5. ECCV 2020 论文大盘点-人脸技术篇
  6. CVPR 2020|不惧目标遮挡,英伟达提出全景感知的图像合成方法
  7. PyTorch实现的李沐《动手学深度学习》,登上GitHub热榜,获得1000+星
  8. 新年快乐!我爱计算机视觉干货集锦与新年展望
  9. access control java_Java Access Controller
  10. 资深程序员:Python中你不知道的那些小工具