摘要:Every year, Farmer John's N (1 <= N <= 20,000) cows attend "MooFest",a social gathering of cows from around the world. MooFest involves a variety of e
阅读全文
摘要:Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star
阅读全文
摘要:The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D
阅读全文
摘要:Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going th
阅读全文
摘要:King George has recently decided that he would like to have a new design for the royal graveyard. The graveyard must consist of several sections, each
阅读全文
摘要:Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integ
阅读全文
摘要:A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Wri
阅读全文
摘要:Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she
阅读全文
摘要:The zoo have N cats and M dogs, today there are P children visiting the zoo, each child has a like-animal and a dislike-animal, if the child's like-an
阅读全文
摘要:传递闭包最开始是在Floyd-Warshall算法里面出现的,当时这算法用的很少就被我忽视了。。 传递闭包是指如果i能到达k,并且k能到达j,那么i就能到达j Have you ever read any book about treasure exploration? Have you ever
阅读全文
摘要:有向图的最小路径覆盖=V-二分图最大匹配。 Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that
阅读全文
摘要:D. Mike and distribution time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has always
阅读全文
摘要:C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has a seque
阅读全文
摘要:The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason
阅读全文
摘要:Thanks to a certain "green" resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the
阅读全文
摘要:You’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sunny evening, and a soo
阅读全文
摘要:Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries
阅读全文
摘要:Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from the second hour until the end of the contest. Bahos
阅读全文
摘要:There are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C know each other. Bu
阅读全文
摘要:onsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible
阅读全文
摘要:You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end poin
阅读全文
摘要:Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top s
阅读全文
摘要:We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no in
阅读全文
摘要:Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on i
阅读全文
摘要:Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put
阅读全文
摘要:After retirement as contestant from WHU ACM Team, flymouse volunteered to do the odds and ends such as cleaning out the computer lab for training as e
阅读全文