The 15th UESTC Programming Contest Preliminary D - Destr0y City cdoj1558
地址: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的更多相关文章
- The 15th UESTC Programming Contest Preliminary J - Jermutat1on cdoj1567
地址:http://acm.uestc.edu.cn/#/problem/show/1567 题目: Jermutat1on Time Limit: 3000/1000MS (Java/Others) ...
- 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 ...
- 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) ...
- 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) ...
- 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 ...
- 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 ...
- 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 ...
- 【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 ...
- 【字符串哈希】The 16th UESTC Programming Contest Preliminary F - Zero One Problem
题意:给你一个零一矩阵,q次询问,每次给你两个长宽相同的子矩阵,问你它们是恰好有一位不同,还是完全相同,还是有多于一位不同. 对每行分别哈希,先一行一行地尝试匹配,如果恰好发现有一行无法对应,再对那一 ...
随机推荐
- 10条建议帮助你创建更好的jQuery插件
本文总结了帮助你创建更好jQuery插件的10条建议.分享给大家供大家参考.具体说明如下: 在开发过很多 jQuery 插件以后,我慢慢的摸索出了一套开发jQuery插件比较标准的结构和模式.这样我就 ...
- “几何画板+MathType”双11组合特价,优惠多多
工欲善其事,必先利其器!几何画板和MathType作为数学老师必备工具,在数学教学中起着非常重要的作用.为回馈老师们做出的伟大贡献,在双11狂欢节期间,MathType和几何画板迎来史上第一次组合特惠 ...
- springmvc 发送PUT 和 DELETE 请求
一: 发送 DELETE 或者 PUT 请求: 1.在表单中加入一个隐藏的参数: _method , 值是 DELETE (或者PUT) <form action="springmv ...
- Numpy库解析
python中的axis 其实问题理解axis有问题,df.mean其实是在每一行上取所有列的均值,而不是保留每一列的均值.也许简单的来记就是axis=0代表往跨行(down),而axis=1代表跨列 ...
- ionic listview对象的编辑、排序和删除
1)ionic的listview对象即<ion-list></ion-list> 2)添加并显示编辑按钮(添加其他自定义按钮也一样) can-swipe属性设置为true(默认 ...
- $("#btn").click(function(){ });只有在页面加载的时候才会有效触发
例: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title& ...
- SQL TRIM()函数去除字符串头尾空格
SQL TRIM()函数去除字符串头尾空格 SQL 中的 TRIM 函数是用来移除掉一个字串中的字头或字尾.最常见的用途是移除字首或字尾的空白.这个函数在不同的资料库中有不同的名称: MySQL: T ...
- 如何把IOS应用,发给别人测试?
ios应用,除了用XCODE连接真实设备调试以外,也可以制作ipa安包,发给别人测试.下面是具体步骤: 1. 把要测试的设备标识添加到你苹果开发账号的调试设备里.(可以用xcode或者itools查看 ...
- Vue.js_getter and setter
computed 计算属性: 1.get 读取 <div id="test2"> <input type="text" v-model=&qu ...
- CH5E01 乌龟棋【线性DP】
5E01 乌龟棋 0x5E「动态规划」练习 描述 小明过生日的时候,爸爸送给他一副乌龟棋当作礼物.乌龟棋的棋盘是一行N 个格子,每个格子上一个分数(非负整数).棋盘第1 格是唯一的起点,第N 格是终点 ...