地址: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%));
}

The 15th UESTC Programming Contest Preliminary D - Destr0y City cdoj1558的更多相关文章

  1. The 15th UESTC Programming Contest Preliminary J - Jermutat1on cdoj1567

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

  2. 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 ...

  3. The 15th UESTC Programming Contest Preliminary B - B0n0 Path cdoj1559

    地址:http://acm.uestc.edu.cn/#/problem/show/1559 题目: B0n0 Path Time Limit: 1500/500MS (Java/Others)    ...

  4. 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) ...

  5. The 15th UESTC Programming Contest Preliminary M - Minimum C0st cdoj1557

    地址:http://acm.uestc.edu.cn/#/problem/show/1557 题目: Minimum C0st Time Limit: 3000/1000MS (Java/Others ...

  6. The 15th UESTC Programming Contest Preliminary G - GC?(X,Y) cdoj1564

    地址:http://acm.uestc.edu.cn/#/problem/show/1564 题目: G - GC?(X,Y) Time Limit: 3000/1000MS (Java/Others ...

  7. 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 ...

  8. 【set】【可持久化Trie】The 16th UESTC Programming Contest Preliminary K - Will the circle be broken

    题意:You are given an array A of N non-negative integers and an integer M. Find the number of pair(i,j ...

  9. 【字符串哈希】The 16th UESTC Programming Contest Preliminary F - Zero One Problem

    题意:给你一个零一矩阵,q次询问,每次给你两个长宽相同的子矩阵,问你它们是恰好有一位不同,还是完全相同,还是有多于一位不同. 对每行分别哈希,先一行一行地尝试匹配,如果恰好发现有一行无法对应,再对那一 ...

随机推荐

  1. LoadRunner中的异常处理

    在脚本的Run-time Settings中,可以设置在脚本运行过程中发生错误的处理方式.进入到Run-time Settings中,切换到Miscellaneous标签页,可以看到Error Han ...

  2. C++之强制类型转换

     C++ Code  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...

  3. 【ArcGIS for Android】基于位置查询Graphic和Feature

    1.graphicsLayer.getGraphicIDs(x, y, 20); 2.featureLayer.getFeatureIDs(x, y, 20); x.y为屏幕坐标 20量纲为dp px ...

  4. ecstore 修改后台搜索框搜索字段的排序顺序

    Ecstore后台要添加搜索字段,只需要在dbschema里写filtertype和filterdefault就行了,但要修改搜索字段的顺序要怎么弄呢?? 经测试,直接在dbschema文件里修改字段 ...

  5. iOS各种问题处理

    本文转载至:http://www.cnblogs.com/ygm900/category/436923.html 推荐初学者前去学习.     mac 拷贝文件时报错 8060 解决方案 摘要: 解决 ...

  6. vue 把后台返回的json拼接成excel并下载

    先封装一下生成excel的方法 downfile.js export default { data() { return {} }, components: {}, created() { }, me ...

  7. java 程序命名规则

    程序命名规则提示:模块设计人员确定本软件的模块命名规则(例如类.函数.变量等),确保模块设计文档的风格与代码的风格保持一致.可以从机构的编程规范中摘取或引用(如果存在的话).命名规则1.包命名     ...

  8. uitextFiled字数输入限制

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementS ...

  9. jsonarray 循环

    JSONArray groupList = JSON.parseArray(st1); for (int i=0;i<groupList.size();i++){ JSONObject json ...

  10. Linux系统CPU核数等信息查看

    版权声明:本文为原创文章,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明. https://blog.csdn.net/fgf00/article/details/52584 ...