Felix Halim .NET  
University Experience
IOI 2002 Yong In, Korea
ACM ICPC Regional Manila 2003
ACM ICPC Regional Manila 2004
ACM ICPC Regional Manila 2005
ACM ICPC Regional Kaohsiung 2006
ACM ICPC Regional Singapore 2007
ACM ICPC Regional Jakarta 2008 (ext)
ACM ICPC Regional Jakarta 2009 (ext)
ACM ICPC Regional Jakarta 2010
ACM ICPC Regional Jakarta 2012  Problem H
ACM ICPC Regional Jakarta 2013  Problem J (new!)
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
Indonesia National Contest 2010
Facebook Hacker Cup 2011


ACM/ICPC Indonesia National Contest 2007Problem CPlaying With DominoTime Limit: 1sA domino is a 2x1 rectangular tile with a line dividing its face into two squares, each with a certain number of dots from zero spots to six spots. As you might know, there are many different games which can be played using dominoes. In most games, dominoes are played by arranging them into a single chain where adjacent dominoes must have matching numbers (see example illustration below). There are 28 possible faces in a complete set of domino: 00, 01, 02, 03, 04, 05, 06, 11, 12, 13, 14, 15, 16, 22, 23, 24, 25, 26, 33, 34, 35, 36, 44, 45, 46, 55, 56, 66. Of course you can play each domino in either direction. For example, you can play 16 as 1/6 or 6/1 depending on your need. Write a program to find the longest chain that can be made from a given set of dominoes. There may be more than one domino with the same face. InputInput contains several cases. Each case begins with an integer N (1 <= N <= 1,000) denoting the number of available domino. Each of the following N lines contains a pair of number (0 to 6) which represents the domino. The first number in each pair is always smaller or equal to the second number.OutputFor each case, print in a single line the number of domino used in the longest domino chain.Sample Input6 2 5 0 1 1 6 2 3 1 2 4 5 2 0 1 3 5 Sample Output4 1 Problem Setter: Ang Ing Ing Kembali ke pembahasan soal ini Lihat problem lain: 