百炼OJ - 1005 - I Think I Need a Houseboat
题目链接:http://bailian.openjudge.cn/practice/1005/
思路
一个半圆面积每年增长50,已知一个点坐标,求第几年点在半圆内。
#include <stdio.h>
#include <math.h>
#define pai 3.1415926
int main()
{
int n;
double x,y;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%lf %lf",&x,&y);
double d = sqrt(x*x+y*y);
for(int j=1;;j++)
{
double r = sqrt((j*100.0)/pai);
if( r > d )
{
printf("Property %d: This property will begin eroding in year %d.\n",i+1,j);
break;
}
}
}
puts("END OF OUTPUT.");
return 0;
}
百炼OJ - 1005 - I Think I Need a Houseboat的更多相关文章
- 从HD OJ 1005想到的
杭电OJ [1005](http://acm.hdu.edu.cn/showproblem.php?pid=1005): #####Problem Description > A number ...
- POJ. 1005 I Think I Need a Houseboat(水 )
POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...
- (light OJ 1005) Rooks dp
http://www.lightoj.com/volume_showproblem.php?problem=1005 PDF (English) Statistics Forum Tim ...
- Light oj 1005 - Rooks (找规律)
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1005 纸上画一下,找了一下规律,Ank*Cnk. //#pragma comm ...
- 九度OJ 1005:Graduate Admission (排序)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5646 解决:1632 题目描述: It is said that in 2011, there are about 100 graduat ...
- 九度oj 1005
题目1005:Graduate Admission 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6182 解决:1791 题目描述: It ...
- Light OJ 1005 - Rooks(DP)
题目大意: 给你一个N和K要求确定有多少种放法,使得没有两个车在一条线上. N*N的矩阵, 有K个棋子. 题目分析: 我是用DP来写的,关于子结构的考虑是这样的. 假设第n*n的矩阵放k个棋子那么,这 ...
- Light Oj 1005
题意: 从 n*n 的棋盘中放置 K 个 行和列不冲突的棋子 思路: 组合数学, 先选 k 个 行, k 个列, 就是 C(n,k) ^ 2; 然后 K 个棋子不相同, K ! 全排列 #includ ...
- Light OJ 1005 - Rooks 数学题解
版权声明:本文作者靖心.靖空间地址:http://blog.csdn.net/kenden23/,未经本作者同意不得转载. https://blog.csdn.net/kenden23/article ...
随机推荐
- pip 更换镜像源
国内的pip源 阿里云:https://mirrors.aliyun.com/pypi/simple/ 清华:https://pypi.tuna.tsinghua.edu.cn/simple 中国科技 ...
- 【转】IEnumerable接口的一个简单示例
转:https://blog.csdn.net/wang371756299/article/details/8197075 摘要: IEnumerable接口是实现foreach循环的一个重要的接口, ...
- c# 调用c++类库控制usb继电器
网上找不到调用此类库的文章,简单写一下,以备后用. 下面是封装后的调用c++类库的类 public class UsbRelayDeviceHelper { /// <summary> / ...
- 虚拟机floppy0
网上搜索方法是:删除该虚拟机的软盘即可. 具体原因还不知道,以后再补上原因
- Codeforce 474A - Keyboard
Our good friend Mole is trying to code a big message. He is typing on an unusual keyboard with chara ...
- host文件无写权限时,怎么设置
点击文件属性---安全---选择对应的用户---编辑属性---勾选需要的属性---应用---确定
- .net Core 安装在linux上
1.安装 .net Core 参考官方网站 https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install 2.发布应用程 ...
- Python自定义任务发邮件提醒
前言 在工作中,有时会有一些定期需要执行的任务或在将来某一天需要执行的任务,为避免疏漏,设计个小工具,发邮件提醒自己去处理. 方案简介 1.建立一个Excel文件,里面定义好待提醒的任务 2.建立一个 ...
- asp.net mvc获取http body中的json
今天遇到一个对方直接post 一共json对象字符串过来的场景.按照以前的旧方案方法可以直接在request.inputstream里面读取,然后反序列化即可.(当然估计ASP.NET MVC应该有更 ...
- Codeforces Round #600 (Div. 2) D。 Harmonious Graph
#include<iostream> using namespace std ; ; int p[N]; int cnt; int find(int x) { if(p[x]!=x) p[ ...