E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
10167
UVA
10167
- Birthday Cake
BackgroundLucyandLilyaretwins.Todayistheirbirthday.Motherbuysabirthdaycakeforthem.NowweputthecakeontoaDescartescoordinate.Itscenterisat(0,0),andthecake'slengthofradiusis100.Thereare2N(Nisainteger,1 #
hellobin
·
2013-03-15 17:00
birt
uva-
10167
- Birthday Cake
题意:给你一系列的点,让你找出一条直线AX+BY=0,使直线把这一系列的点分为两个部分。由于A,B的范围在-500~500之间,所以直接枚举就可以了。反思:由于没仔细看题意,Iftherearemanysolutions,youcanonlyprintoneofthem.这句话让我吃亏了。调试的程序和SampleOutput不一样,然后就纠结了老久。。。。#include #include usi
rowanhaoa
·
2012-09-24 11:00
list
output
UVa
10167
Birthday Cake
题目: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=107&page=show_problem&problem=1108 直接从-500到500枚举A和B,非常简单。 #include<iostream> #include<
Jianquan
·
2012-08-16 20:00
UVa10167
Birthday Cake
UVa
10167
- Birthday Cake
暴力,最多一百个点,将所有点带入方程,使得大于零与小于零的个数相同(直线两边点的个数相同)。刚开始只判断了一边==num ,WA了好几边,换成两边都==num后,AC了~~代码如下:#include #include #include #include voidmakeit(int*a,int*b,intnum) { inti,j; for(i=-100;i0) x++; elseif(l<0)
GooMaple
·
2012-08-01 13:00
uva
10167
- Birthday Cake
ProblemG.BirthdayCake BackgroundLucyandLilyaretwins.Todayistheirbirthday.Motherbuysabirthdaycakeforthem.NowweputthecakeontoaDescartescoordinate.Itscenterisat(0,0),andthecake'slengthofradiusis100.Ther
Frankiller
·
2012-07-29 19:00
Integer
input
each
border
dataset
Numbers
UVa
10167
Birthday Cake
题目链接:(—_—)zZ直接枚举A与Bcode: #include intmain() { inti=0,j=0,k=0,n=0,sum=0,flag=0,x[102],y[102]; while(scanf("%d",&n),n) { for(i=0;i0) sum++; } if(sum==n&&!flag) break; } if(sum==n) break; } printf("%d%d\
ulquiorra0cifer
·
2012-07-18 10:00
uva
10167
- Birthday Cake
点击打开链接题目意思:给定一个半径为100的蛋糕,蛋糕上面有许多的樱桃,现在要求一次性平均分蛋糕,并且对应的樱桃的数量要相等。要求这个均分的直线AX+BY=0的A和B的一个解解题思路:题目规定半径的值,还有AB的范围,我们知道一条直线能够将点平均分成两半,点不会落在直线上,那么我们知道对于点带入直线如果值大于0则点在直线上方,反之在下方。只要慢足上方的点等于下方的点并且所以点不会落在直线上就可以,
cgl1079743846
·
2012-07-14 00:00
UVaOJ
10167
- Birthday Cake
——byACodeRabbitDescription两个小女孩生日了,但是小气的妈妈只买一个蛋糕,所以你就悲剧了。蛋糕上有2N个樱桃,你要把蛋糕一刀切成均等的两半,并且樱桃数也平均分。蛋糕是圆形的,令蛋糕的中心为坐标轴的原点。输入樱桃的位置。输出A,B使得Ax+By=0为切下去那一刀的轨迹。TypesBruteForce::ElementarySkillsAnalysis这题的关键其实在于题目的数
Ra_WinDing
·
2012-07-13 22:00
【UVa
10167
】 Birthday Cake,思路+代码+解题报告
#include #include #include #include //#defineINPUT /** Problem:UVA
10167
-BirthdayCake BeginTime:22nd/Mar
c0de4fun
·
2012-03-22 19:00
struct
input
include
Uva OJ
10167
birthday cake
直接枚举法 蛋糕的半径为100,所以a*x+b*y=0中 -100#includeusingnamespacestd;typedefstruct{ intx,y;}point;intIs_yice(pointpoint1,inta,intb){ if((point1.x*a+b*point1.y)0)return1;}intmain(){ intn; while(sca
LiWen_7
·
2012-03-02 16:00
10167
- Birthday Cake
/* 简单题。 依次历编A,B的值,判断直线上和直线下的个数判断结果 */ #include intmain() { //freopen("data.in","r",stdin); intN; inta[120],b[120]; while(scanf("%d",&N)==1) { if(N==0) break; for(inti=0;i0) r++; elseif(A*a[i]+B*b[i]N
lhshaoren
·
2012-02-13 23:00
UVa Problem
10167
Birthday Cake (生日蛋糕)
//BirthdayCake(生日蛋糕) //PC/UVaIDs:111305/
10167
,Popularity:C,Successrate:averageLevel:2 //Verdict:Accepted
metaphysis
·
2011-11-12 10:00
c
Date
struct
UP
ZOJ 3166题解 最短路径之Floyd算法
1#include2#include3#include4#defineMaxint99999995#defineMax
10167
intmain()8{9intM,N,hotel[101],a,C,b,t
·
2011-11-06 16:00
floyd
uva
10167
题目大意:一个圆饼,上面有2N个樱桃,切一刀,使两块上面都有相等的樱桃。分析:由于圆饼半径只有100,所以枚举A,B,-100到100.对于每一种A,B,看看直线两边点数是不是相同,注意题目中很多点不在饼上面。代码:#include #include #include #include usingnamespacestd; structPOINT { intx,y; }poin
zhang20072844
·
2011-10-04 01:00
UVa
10167
Birthday Cake
UVa
10167
BirthdayCake采用枚举。首先,Ax+By=0必须表示直线,即A、B不能同时为0;另外,要注意到直线不能过输入中的2N个点;检测点在直线的哪一侧,只需要简单的线性规划的知识。
心如止水
·
2011-04-18 00:00
10167
--Birthday Cake
////暴力求解,本题主要利用生成随机数来试探求解///主要函数有srand():设置随机种子,一般以当前时间来设置随机种子,即为srand((unsigned)time(NULL))///randomize()也是这个效果///rand()生成0-32767范围内的数///rand()和srand()都包含在头文件stdlib.h中///time()是日历时间,time(NULL)得到的是当前时
fengyu0556
·
2010-05-25 18:00
null
日历
上一页
1
2
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他