hdu2073

数学

 #include<stdio.h>
#include<math.h>
double len(double x){
return sqrt(x*x+(x+)*(x+));
} int main(){
int N;
while(scanf("%d",&N)!=EOF){
for(int q=;q<=N;q++){
double x1,y1,x2,y2;
double l=;
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
if(x1+y1==x2+y2){
l=abs(y1-y2)*sqrt(2.0);
}
else{
double a,b;
if(x1+y1>x2+y2){
double t;
t=x1;x1=x2;x2=t;
t=y1;y1=y2;y2=t;
}
a=x1+y1;b=x2+y2;
int i;
for(i=a;i<b;i++) l+=len(i);
l+=((a+b)*(b-a-)/+y1+x2)*sqrt(2.0);
}
printf("%.3lf\n",l); }
}
return ;
}

hdu2074

模拟

 #include<stdio.h>

 char pic[][];

 int main(){
int n,count=;
char a,b;
while(scanf("%d %c %c",&n,&a,&b)!=EOF){
if(count)printf("\n");
count++;
int i,j,h,l,c=;
char m;
for(i=(n+)/;i>=;i--){
h=i;l=n+-i;
m=(c%)?a:b;
c++;
for(j=h;j<=l;j++){
pic[h][j]=pic[l][j]=pic[j][h]=pic[j][l]=m;
}
}
pic[][]=pic[][n]=pic[n][]=pic[n][n]=' ';
if(n==)pic[][]=a;
for(i=;i<=n;i++){
for(j=;j<=n;j++){
printf("%c",pic[i][j]);
}
printf("\n");
}
}
return ;
}

hdu2075

暴力

 #include<stdio.h>
int main()
{
int T;
while (scanf("%d",&T)!=EOF)
{
int i;
for (i=;i<=T;i++)
{
long long A,B;
scanf("%I64d%I64d",&A,&B);
if (A%B) printf("NO\n");
else printf("YES\n");
}
}
return ;
}

hdu2076

计算时钟夹角,数学

 #include<stdio.h>
#include<math.h> int main(){
int h,m,s,T;
while(scanf("%d",&T)!=EOF){
for(int q=;q<=T;q++){
scanf("%d%d%d",&h,&m,&s);
if(h>=)h-=;
double a,b;
a=(*h+*m/60.0+*s/3600.0);
b=(*m+*s/60.0);
double t=a-b;
if(t>) t=-t;
else if(t<-) t=t+;
else if(t<) t=-t;
int p=t;
printf("%d\n",p);
}
}
return ;
}

hdu2077

汉诺塔改,数学公式

 #include<stdio.h>
long long a[],b[],c[],k[]; void fun(){
int i;
k[]=;
for(i=;i<=;i++)k[i]=*k[i-]+;
a[]=;
for(i=;i<=;i++)a[i]=k[i-]+a[i-]+;
b[]=;
for(i=;i<=;i++)b[i]=b[i-]++k[i-];
c[]=;
for(i=;i<=;i++)c[i]=a[i-]++b[i-];
} int main(){
fun();
int T;
while(scanf("%d",&T)!=EOF){
for(int q=;q<=T;q++){
int n;
scanf("%d",&n);
printf("%I64d\n",c[n]);
}
}
return ;
}

hdu2078

模拟

 include<stdio.h>

 int main()
{
int T;
while (scanf("%d",&T)!=EOF)
{
int i;
for (i=;i<=T;i++)
{
int n,m;
scanf("%d%d",&n,&m);
int max=,j,min=,a;
for (j=;j<=n;j++)
{
scanf("%d",&a);
if (a<min) min=a;
}
printf("%d\n",(max-min)*(max-min));
}
}
return ;
}

hdu2073-2078的更多相关文章

  1. HDU 2078 复习时间

    http://acm.hdu.edu.cn/showproblem.php?pid=2078 Problem Description 为了能过个好年,xhd开始复习了,于是每天晚上背着书往教室跑.xh ...

  2. URAL 2078~2089

    URAL 2078~2089 A - Bowling game 题目描述:给出保龄球每一局击倒的球数,按照保龄球的规则,算出总得分的最小值和最大值. solution 首先是最小值:每一局第一球击倒\ ...

  3. PDF 补丁丁 0.5.0.2078 测试版发布:不用打字,也能加书签

    新增功能: 在书签编辑器加书签,不再需要自己输文本. 书签编辑器的阅读界面增加了识别文本字符的功能,可使用该功能在添加书签时识别文本. 右键点击文本内容,可插入书签(对于扫描版的文档,在激活识别引擎后 ...

  4. 2078 Problem H Secret Message 中石油-未提交-->已提交

    题目描述 Jack and Jill developed a special encryption method, so they can enjoy conversations without wo ...

  5. 【BZOJ】2078: [POI2004]WYS

    题意: 给n个互不相交的多边形(边均平行于坐标轴),问最大深度.深度的定义是,若多边形A被多边形B包含,则\(dep[A]=max(dep[B])+1\).坐标系的深度为0.(n<=40000, ...

  6. POJ 2078 Matrix

    Matrix Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 3239   Accepted: 1680 Descriptio ...

  7. hdu 2078

    ps:超水题....(a+b)^2>=a^2+b^2...刚开始还想了好久...真佩服自己.. #include "stdio.h" #define min1(a,b) a& ...

  8. HDU2073(暴力) VS HDU5214(贪心)

    题意:给出n组l[i],r[i],求出能够相互连接的最大个数,比如(1,2) ,(2,3),(5,6)就是可以连接的3组数据: 思路:2073数组大小为100,纯暴力就可以了,不过注意排序时,按照r的 ...

  9. hdu2073递推题

    无限的路 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissio ...

  10. HDOJ(HDU) 2078 复习时间

    Problem Description 为了能过个好年,xhd开始复习了,于是每天晚上背着书往教室跑.xhd复习有个习惯,在复习完一门课后,他总是挑一门更简单的课进行复习,而他复习这门课的效率为两门课 ...

随机推荐

  1. OpenGL入门程序三:点、线、面的绘制

    1.点: void TestPoint() { //点的大小默认为一个像素,通过下面的函数可以设置一点的大小 glPointSize(50.0f); glBegin(GL_POINTS); glVer ...

  2. jsp/post中文乱码问题

    在 iso-8859-1,gb2312, utf-8 以及任意一种编码格式下,英文编码格式都是一样的,每个字符占8位,而中文就麻烦了,在gb2312 下一个中文占 16位,两字节,而在utf-8 下一 ...

  3. 实训10a--用数据值填充下拉列表

    1.新建mvc4项目,选择基本模板. (1)点击“开始->所有程序->Microsoft Visual Studio 2012->Visual Studio 2012”菜单,打开Vi ...

  4. LeetCode--038--报数(*)

    问题描述: 报数序列是指一个整数序列,按照其中的整数的顺序进行报数,得到下一个数.其前五项如下: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 被读作  "one ...

  5. ajax思维导图

  6. 启动Eclipse时发生An internal error occurred during: "Initializing Java Tooling"错误

    详细提示如下: An internal error occurred during: "Initializing Java Tooling". Illegal exception ...

  7. EBS Workflow参考资料

    参考资料: How to send an email from oracle workflow process using an AdHocRole? Notification System APIs ...

  8. dup的使用

    转自:http://www.cnblogs.com/GODYCA/archive/2013/01/05/2846197.html 下面是关于实现重定向的函数dup和dup2的解释: 系统调用dup和d ...

  9. STM32F103各PIN脚封装图

    1.36PIN 2.48PIN 3.64PIN 4.100PIN STM32ZET6详细pin脚图

  10. 我的一起开源网 www.17ky.net上线了

    .net开源生态的落后,使得.net开发人员所拥有的开源资源比其他语言的开发者少了很多,这也使得笔者很早之前就喜欢收集各种开源项目,经常会去逛codeplex,开源中国社区等网站,同时也喜欢在自己或公 ...