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
Balls
Careercup - Microsoft面试题 - 5204967652589568
2014-05-11 23:57 题目链接 原题: 9 identical
balls
. one ball is heavy. find the heavy ball with only 2 measurements
·
2015-10-27 14:54
Microsoft
每日英语:China: A Billion Strong but Short on Workers
years, Cui Haifeng worked in China's manufacturing industry, stitching together leather to make soccer
balls
·
2015-10-27 14:41
worker
双色球
php //双色球实例 $
balls
= range(1,33); $redBallsIndex = array_rand($
balls
, 6); $blueBall = mt_rand(1,16
·
2015-10-27 14:59
暑假集训-组合数学及数论
群——Burnside定理 容斥原理 12 / 58 Problem A CodeForces 554C Kyoya and Colored
Balls
·
2015-10-27 13:32
数学
2013 Multi-University Training Contest 2
HDU-4611
Balls
Rearrangement 题意:具体题意不大清楚,最后要处理一个这样的表达式:sum{ |i % a - i % b| },0 <= i < N
·
2015-10-27 12:50
test
hdu 4611
Balls
Rearrangement(规律)
题目链接:hdu4611BallsRearrangement代码#include #include #include usingnamespacestd; typedeflonglongll; intN,A,B; llget(llp){ inta=p%A; intb=p%B; returna>b?a-b:b-a; } llsolve(lln){ llret=0,p=0,a=A,b=B,v;
u011328934
·
2015-10-26 21:00
poj3476 A Game with Colored
Balls
每次取最长的最左边一段,可以使用优先队列来实现。而对于每次删除一段则可以使用链表来实现,事实上这里使用数组来模拟链表会有更好的效果。而且最后的评测使用g++会TLE(应该是我代码残了),使用c++可以过。#include #include #include usingnamespacestd; structNode { charc; intpos,len; Node(charc,inta,int
u010005180
·
2015-10-25 12:00
Kyoya and Colored
Balls
排列组合
Kyoya and Colored
Balls
Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest
·
2015-10-23 09:46
codeforces
Balls
Game 并查集
Balls
Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/430/
·
2015-10-23 09:05
codeforces
POJ 3687 Labeling
Balls
-----变种拓扑排序
Labeling
Balls
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8219  
·
2015-10-23 08:33
label
HDU 4611
Balls
Rearrangement(2013多校2 1001题)
Balls
Rearrangement Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535
·
2015-10-21 12:13
HDU
hdu3635 Dragon
Balls
(带权并查集)
1 /* 2 题意:有N个城市, 每一个城市都有一个龙珠(编号与城市的编号相同),有两个操作 3 T A ,B 将标号为A龙珠所在城市的所有的龙珠移动到B龙珠所在城市中! 4 5 思路:并查集 (压缩路径的时候将龙珠移动的次数进行更新) 6 */ 7 #include<iostream> 8 #include<cstr
·
2015-10-21 12:29
drag
UVa-679 - Dropping
Balls
直接模拟会超时 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 const int maxx=21; 6 int d,n; 7 bool f[1<<maxx]; 8 int main() 9
·
2015-10-21 11:57
ping
Kyoya and Colored
Balls
-组合数学
http://codeforces.com/contest/554/problem/C题意可看作 给m个颜色的气球,每种颜色有一定数量(至少为1)然后构造出第k个颜色的气球后面不存在有比k小的颜色的气球存在。。。的方案数正向构造毕竟麻烦,最最后一个入手比较简单、气球总是为sum、第i种颜色气球有a[i]个最后一个肯定是第K个颜色,因为序列长度固定为sum,所以第k个颜色摆放方案是C(sum-1,a
viphong
·
2015-10-06 16:00
java14:玩彩票
java.util.Arrays; import java.util.Random; public class Demo01 { public static void main(String[] args) { int[]
balls
浪漫的偷笑
·
2015-10-02 08:56
import
package
public
彩票
java14:玩彩票
java.util.Arrays; import java.util.Random; public class Demo01 { public static void main(String[] args) { int[]
balls
浪漫的偷笑
·
2015-10-02 08:56
import
package
public
彩票
java14:玩彩票
java.util.Arrays;import java.util.Random;public class Demo01 {public static void main(String[] args) {int[]
balls
浪漫的偷笑
·
2015-10-02 08:56
彩票
package
import
Java
POJ 3687 Labeling
Balls
逆向拓扑排序,贪心思想
题意:有n个球,他的重量从1到n个重量单位,每一个球都有自己的重量单位,并不会重复,现在给你一些顺序ab,表示a的重量比b小,让你按字典序最小找出符合所有条件的序列每一个元素表示i-th个球在序列中的位置。想法:开始以为直接正向建边然后,top_sort从小到大找,然后输出就好了。但是这样是不对的,因为我们可以知道,如果用这种方法,得到的是球的编号的字典序输出。5451421323就是这组数据,给
Triple_WDF
·
2015-09-27 16:00
想法题
Dragon
Balls
3635 (并查集求深度) 好题
DragonBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4571 AcceptedSubmission(s):1741ProblemDescriptionFivehundredyearslater,thenumberofdragonball
yanghui07216
·
2015-08-24 19:00
CodeForces 553A Kyoya and Colored
Balls
(排列组合)
http://codeforces.com/problemset/problem/553/AA.KyoyaandColoredBallstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKyoyaOotorihasabagwithncoloredballsthata
hellohelloC
·
2015-08-20 18:00
hdu 3635 Dragon
Balls
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3635解题思路:题目大意:初始时,有n个龙珠,编号从1到n,分别对应的放在编号从1到n的城市中。给你2种操作:TAB,表示把A球所在城市全部的龙珠全部转移到B城市。(第一次时,因为A球所在的城市只有一个球,所以只移动1个,如果有多个,则全部移动)。QA,表示查询A。输出信息。信息分别为:A现在所在的城市
piaocoder
·
2015-08-15 17:00
并查集
POJ 3687 Labeling
Balls
(逆向建边)
DescriptionWindyhas N ballsofdistinctweightsfrom1unitto N units.Nowhetriestolabelthemwith1to N insuchawaythat:Notwoballssharethesamelabel.Thelabelingsatisfiesseveralconstrainslike"Theballlabeledwith a
Misdom_Tian_Ya
·
2015-08-15 15:00
Labeling
Balls
3687(拓扑排序+反向建图)
LabelingBallsTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:12262 Accepted:3511DescriptionWindyhasNballsofdistinctweightsfrom1unittoNunits.Nowhetriestolabelthemwith1toNinsuchawaythat:Notwoballssh
yanghui07216
·
2015-08-14 21:00
POJ 3687 Labeling
Balls
(拓扑排序,逆序)
LabelingBallsTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:12256 Accepted:3510DescriptionWindyhasNballsofdistinctweightsfrom1unittoNunits.Nowhetriestolabelthemwith1toNinsuchawaythat:Notwoballssh
helloiamclh
·
2015-08-14 18:00
POJ 3687--Labeling
Balls
【拓扑排序 && 逆序拓扑 && 输出在拓扑排序中的位置】
LabelingBallsTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 12251 Accepted: 3509DescriptionWindyhas N ballsofdistinctweightsfrom1unitto N units.Nowhetriestolabelthemwith1to N insuchawaythat:No
hpuhjh
·
2015-08-14 16:00
hdu 3635 Dragon
Balls
(并查集,路径压缩应用)
DragonBallsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4465AcceptedSubmission(s):1706ProblemDescriptionFivehundredyearslater,thenumberofdragonballswillinc
WinJourn
·
2015-08-11 21:14
并查集
hdu 3635 Dragon
Balls
(并查集,路径压缩应用)
DragonBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4465 AcceptedSubmission(s):1706ProblemDescriptionFivehundredyearslater,thenumberofdragonball
chaiwenjun000
·
2015-08-11 21:00
图论
Poj 3687 Labeling
Balls
(逆向Topo)
LabelingBallsTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 12027 Accepted: 3455DescriptionWindyhas N ballsofdistinctweightsfrom1unitto N units.Nowhetriestolabelthemwith1to N insuchawaythat:No
Grit_ICPC
·
2015-08-07 21:00
idtransmarksp
并查span
hdoj 3635 Dragon
Balls
【并查集】
DragonBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4364 AcceptedSubmission(s):1667ProblemDescriptionFivehundredyearslater,thenumberofdragonball
liu6886
·
2015-08-02 14:00
并查集
Dragon
Balls
DragonBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4357 AcceptedSubmission(s):1661ProblemDescriptionFivehundredyearslater,thenumberofdragonball
yanghui07216
·
2015-08-01 22:00
HDU 3635--Dragon
Balls
【并查集,有技巧】
DragonBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4290 AcceptedSubmission(s):1649ProblemDescriptionFivehundredyearslater,thenumberofdragonball
hpuhjh
·
2015-07-31 23:00
hdu 5125 magic
balls
(dp)
题目链接:hdu5125magicballs#include #include #include usingnamespacestd; constintmaxn=1005; intN,M,dp[maxn][maxn],A[maxn],B[maxn]; intvec[maxn][maxn],c[maxn]; voidinit(){ scanf("%d%d",&N,&M); for(inti=1
u011328934
·
2015-07-29 00:00
Labeling
Balls
LabelingBallsTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:11893Accepted:3408DescriptionWindyhasNballsofdistinctweightsfrom1unittoNunits.Nowhetriestolabelthemwith1toNinsuchawaythat:Notwoballsshar
huayunhualuo
·
2015-07-28 19:00
**poj 3687 Labeling
Balls
(*拓扑排序)
今天刚学了一发拓扑排序,就想找个题水水,结果被这题海虐了。题意:给你n个球,给你m组关系,a #include #include #include #include #include #include #include #include #include #include #include #include #include usingnamespacestd; #defineMAX40005
Miracle_ma
·
2015-07-22 17:00
ACM
hdu3635Dragon
Balls
并查集
//n个龙珠,在n个城市//Tab将包含a的所有龙珠移到b处//Qa//龙珠a在哪个城市,这个城市有多少龙珠,龙珠a移动了多少次//并查集记录所有龙珠//对于移动的次数在find更新的时候优化一下就行#include#include#includeusingnamespacestd;constintmaxn=10010;intF[maxn];intsum[maxn];inttime[maxn];i
cq_pf
·
2015-07-20 22:00
POJ【3687】Labeling
Balls
POJ【3687】LabelingBalls拓扑排序球的重量分别1~n需要给他们标号1~n有m个条件每个条件为ab表示标号为a的球比b的球轻尽量把轻的球给小编号按顺序输出1~n编号对应的球倒序建图拓扑即可代码如下#include #include #include #include #include usingnamespacestd; intin[201],inn[201],wz[201];
ChallengerRumble
·
2015-07-12 18:00
TOPO
Kyoya and Colored
Balls
KyoyaOotorihasabagwith n coloredballsthatarecoloredwith k differentcolors.Thecolorsarelabeledfrom 1 to k.Ballsofthesamecolorareindistinguishable.Hedrawsballsfromthebagonebyoneuntilthebagisempty.Henoti
Kirito_Acmer
·
2015-07-10 14:00
codeforces
cf 553A 排列组合
题意k种颜色,第i种颜色Ci个
balls
求第i种颜色的最后一颗球必须在第i+1种颜色的最后一颗球之前数学排列组合公式C(n,m)=C(n-1,m)+C(n-1,m-1)思路:总的球数为sum,球数为a[
meixiuxiudd
·
2015-07-10 00:00
c
Kyoya and Colored
Balls
C.KyoyaandColoredBallstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKyoyaOotorihasabagwith n coloredballsthatarecoloredwith k differentcolors.Thecolorsare
u010422038
·
2015-07-04 00:00
Codeforces Round #309 (Div. 1) A Kyoya and Colored
Balls
题意:给你K种颜色的球,第i种颜色的球有Si个(K #include #include #defineLLlonglong #defineMOD1000000007 LLA[1111]; LLC[1010][1010]; intmain() { C[0][0]=1; for(inti=1;i=1;i--) { ans=(ans*C[sum-1][A[i]-1])%MOD; sum-=A[i];
u012659423
·
2015-06-27 20:00
Kyoya and Colored
Balls
(Codeforces Round #309 (Div. 2))
C.KyoyaandColoredBallsKyoyaOotorihasabagwith n coloredballsthatarecoloredwith k differentcolors.Thecolorsarelabeledfrom 1 to k.Ballsofthesamecolorareindistinguishable.Hedrawsballsfromthebagonebyoneunt
u010579068
·
2015-06-26 14:00
组合
数论
round
codeforces
and
C.
Colored
Kyoya
#30
hdu5194DZY Loves
Balls
期望
//n个黑球,m个白球,第i个数为白球si=0,为黑球si=1;//求这个串s中出现01的期望//期望是可以加的//那么对于第i个位置出现0第i+1出现1的概率为(n/(n+m))*(m/(n+m-1))//那么期望为n*m/(n+m-1)#include#include#includeusingnamespacestd;intgcd(inta,intb){ if(b==0) returna;
cq_pf
·
2015-06-06 22:00
hihocoder 1135 : Magic Box
When the circus is performing, Sunny puts some
balls
into the box one by one. The
balls
·
2015-06-06 13:00
code
[逆向拓扑排序]POJ3687 Labeling
Balls
看了几页书上的网络流感觉不想看了,找了前面几章的题目打算水一水练手,结果碰上这个题也是很囧。一开始做是正向,从轻到重建边,记录入度,搞优先队列让小序号的先出队,同时搞一个普通队列把每次选的入度为0的点记录下来,结果一发WA。后来仔细看了看题目,结果要输出的是结点的标号。比如最开始第一个选的入度为0的点是5,那么我的第一个答案就是5了,其实题目不是这个意思,第一个答案应该是1第几个被选出队,2第几个
kg20006
·
2015-05-25 17:00
ACM
poj
hdu 3635 Dragon
Balls
#include #include #include usingnamespacestd; constintN=10000+5; intn,bin[N],tot[N],cnt[N];//tot是转移次数,cnt是龙珠次数 int_find(intx) { if(x==bin[x])returnx; else { intt=bin[x]; bin[x]=_find(bin[x]);//路径压缩 t
xinag578
·
2015-05-19 15:00
LightOJ1317---Throwing
Balls
into the Baskets (概率dp)
Youprobablyhaveplayedthegame“ThrowingBallsintotheBasket”.Itisasimplegame.Youhavetothrowaballintoabasketfromacertaindistance.Onedaywe(theAIUBACMMER)wereplayingthegame.Butitwasslightlydifferentfromthema
Guard_Mine
·
2015-05-17 16:00
dp
javascript中DOM复选框选择用法实例
具体如下:复选框全选全清和反选//取得所有的复选框对象数组functionGetAllCheckBox(){vardiv=document.getElementById("
Balls
");varinputs
永远爱好写程序
·
2015-05-14 12:26
hdu3635 Dragon
Balls
ProblemDescriptionFivehundredyearslater,thenumberofdragonballswillincreaseunexpectedly,soit'stoodifficultforMonkeyKing(WuKong)togatherallofthedragonballstogether. HiscountryhasNcitiesandthereareexactl
Kirito_Acmer
·
2015-05-11 13:00
并查集
Codeforces Round #162 (Div. 1) C Choosing
Balls
dp
//dp[i]表示以颜色为i结尾的最大值//dp[i]=max(dp[i],dp[i]+a*v[i],other_max+b*v[i]);//为除颜色i以外的其它颜色的最大值#include#include#includeusingnamespacestd;constintmaxn=100010;const__int64inf=0x7fffffffffffffff;__int64dp[maxn];
cq_pf
·
2015-05-08 17:00
HUD 5194--DZY Loves
Balls
【规律】
DZYLovesBallsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/65536K(Java/Others)TotalSubmission(s):577 AcceptedSubmission(s):317ProblemDescriptionTherearenblackballsandmwhiteballsinthebigbo
hpuhjh
·
2015-04-23 20:00
上一页
3
4
5
6
7
8
9
10
下一页
按字母分类:
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
其他