摘要: Description 每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头牛被所有的牛认为是受欢迎的。 ... 阅读全文
posted @ 2016-03-26 15:22 Loi_Vampire 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Description The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a,... 阅读全文
posted @ 2016-03-26 14:32 Loi_Vampire 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Description trs喜欢滑雪。他来到了一个滑雪场,这个滑雪场是一个矩形,为了简便,我们用r行c列的矩阵来表示每块地形。为了得到更快的速度,滑行的路线必须向下倾斜。 例如样例中的那个矩形,可以从某个点滑向上下左右四个相邻的点之一。例如24-17-16-... 阅读全文
posted @ 2016-03-26 08:10 Loi_Vampire 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Description Welcome to the Hungary Games! The streets of Budapest form a twisted network of one-way streets. 欢迎来到匈牙利游戏!布达佩斯(匈牙利首都... 阅读全文
posted @ 2016-03-26 06:26 Loi_Vampire 阅读(122) 评论(0) 推荐(0) 编辑