Codeforces Round #230 (Div. 2) C. Blocked Points
来源:互联网 发布:淘宝前500名半价怎么抢 编辑:程序博客网 时间:2024/05/22 00:20
画个图找规律。
#include<cstdio>#include<cstring>#include<iostream>#include<cmath>using namespace std;int main(){int n;while(cin>>n){if(n==0){cout<<1<<endl;continue;}double len=sqrt(2)/2*n;int l=len;int k=l+1;if((l*l+(l+1)*(l+1))<=n*n)cout<<(k*2-1)*4<<endl;elsecout<<(k*2-2)*4<<endl;}return 0;}
0 0
- Codeforces Round #230 (Div. 2) C. Blocked Points
- Codeforces Round #230 (Div. 2) C. Blocked Points
- Codeforces Round #230 (Div. 2) C. Blocked Points D. Tower of Hanoi
- Codeforces Round #230 (Div. 2) C. Blocked Points D. Tower of Hanoi
- Codeforces Round #230 (Div. 2) C: Blocked Points 水泄不通的点墙
- Codeforces Round #230 (Div. 2) C. Blocked Points ACM解题报告(暴力)
- Codeforces Round #331 (Div. 2) C. Wilbur and Points
- Codeforces Round #331 (Div. 2) C. Wilbur and Points
- Codeforces Round #331 (Div. 2) C. Wilbur and Points
- Codeforces Round #331 (Div. 2)-C. Wilbur and Points
- Codeforces Round #432 (Div. 2) C Five Dimensional Points
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)C. Five Dimensional Points
- Codeforces Round #331 (Div. 2)C. Wilbur and Points(模拟+STL)
- Codeforces Round #331 (Div. 2)——C. Wilbur and Points
- Codeforces Round #331 (Div. 2) C. Wilbur and Points 贪心+排序
- Codeforces Round #164 (Div. 2) C. Beautiful Sets of Points【思维题】
- Codeforces Round #432 (Div. 2) C 850A Five Dimensional Points(思维)
- Codeforces Round #432 Div. 2 C. Five Dimensional Points(数学)
- 使用vsphere管理和创建VM全过程
- vcenter server appliance的配置(suse linux版vcenter),vshpere web client的使用
- 手机读取ESN等的方法和写号机的基本知识
- java ATM简单编写
- IOS:屏幕旋转与Transform
- Codeforces Round #230 (Div. 2) C. Blocked Points
- 高通audio软件模块功能框图 .
- poj 1019 二分
- 高通平台音频调试心得
- HTTP 返回码查询
- Linux虚拟内存系统常用参数说明
- authorized_keys和authorized_keys2有什么不同?
- Java中的break Label 和continue Label 例子(跳出多重循环)
- 分页查询代码