锘??xml version="1.0" encoding="utf-8" standalone="yes"?> Create a class CraneWork that contains a method moves that is given int[]s stack1, stack2, and warehouse containing the initial three stacks, and returns the minimum number of moves required to move all the crates into the warehouse stack. The elements of stack1, stack2, and warehouse represent the weights of the crates and are given from top to bottom (and thus in non-decreasing order of weight). This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. A palindrome is a string that reads the same forward and backward. A palindrome substring is a contiguous sequence of characters taken from a string that form a palindrome. A palindrome substring of a string is maximal if we can't extend it to get a bigger palindrome substring. For example, string "acdadc" has 2 maximal palindrome substrings - "a" (the first one) and "cdadc". All other palindrome substrings (like "dad" or "c") can be extended to "cdadc", so they are not maximal. You will be given a String[] str. Concatenate the elements of str to form one long string, and return the number of maximal palindrome substrings contained in that string. This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. We can substitute each digit of a number with a unique letter from 'A' to 'Z'. This way we can write groups of numbers in a single representation. For example "ABA" can represent any of the following: 101, 151, 343, 767, 929. However, "ABA" cannot mean 555 because each letter must stand for a distinct digit. Furthermore, numbers cannot begin with 0 and thus 'A' cannot be replaced by 0. Given two such representations num1 and num2 and the result of their summation return the total number of possible combinations of numbers for which the equation holds. If no combinations are possible then return 0. This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. In the factorial number system the value of the first digit (from the right) is 1!, the value of the second digit is 2!, ..., and the value of the n-th digit is n!. This means that any decimal number d can be written in this system as: anan-1...a2a1, where d = an * n! + an-1 * (n-1)! + ... + a2 * 2! + a1 * 1! and 0 <= ai <= i for all i. Given an int num in decimal, return its representation in the factorial number system. This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. A rational number is defined as a/b, where a and b are integers, and b is greater than 0. Furthermore, a rational number can be written as a decimal that has a group of digits that repeat indefinitely. A common method of writing groups of repeating digits is to place them inside parentheses like 2.85(23) = 2.852323 ... 23... Given a decimal representation of a rational number in decimalNumber, convert it to a fraction formatted as "numerator/denominator", where both numerator and denominator are integers. The fraction must be reduced. In other words, the denominator must be as small as possible, but greater than zero. This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
寮濮嬭佹媴蹇冩孩鍑洪棶棰橈紝鏈綆鍗曠殑鏂規硶涓嶆暍鐢紝鑰佹兂鍙﹁緹韞婂緞銆傛渶鍚庡彂鐜版媴蹇冩槸澶氫綑鐨勶紝榪欓噷闇瑕佺敤鍒扮殑鏁板彧鏄◢寰秴榪?2浣嶈屽凡錛屽ぇ澶氭暟楂樼駭璇█閮借兘寰堣交鏉劇殑澶勭悊64浣嶅ぇ鏁存暟錛岃繛javascript涔熷彲浠ュ鐞?4浣嶇殑澶ф暣鏁拌屼笉涓㈠け綺懼害錛岃繙榪滆秴榪囦簡榪欎釜闂鐨勮妯°?br />
榪欓噷鐗瑰湴鎶婅綆楄寖鍥存墿澶т簡5鍊嶆潵媯楠屾孩鍑洪棶棰樸傝妯″啀澶х殑鏃跺欐垜鐨処E璁$畻鏃墮棿瓚呰繃5縐掑紑濮嬭璀﹀憡浜嗐備負浜嗕唬鐮佺畝媧侊紝鎵撲貢嬈″簭浣跨敤浜嗘晥鐜囧緢浣庣殑sort鏂規硶錛屽ぇ閲忕殑鏃墮棿閮芥秷鑰楀湪榪欎竴姝ャ傛妸鎺掑簭鍙傛暟璋冩暣涓?.8錛堣屼笉鏄?.5錛変富瑕佹槸涓轟簡鍑忓皯鎺掑簭璁$畻閲忋?br />
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
var n=500000;//n鏄父鏁?涓嶇畻涓存椂鍙橀噺銆?/span>
var ar=[];//榪欐槸杈撳叆鏁版嵁錛屼笉綆椾復鏃跺彉閲?/span>
for(var i=0;i<n;i++){
ar.push(i+1)
}
//i鏄敓鎴愯緭鍏ユ暟鎹嬌鐢ㄧ殑錛屼笉綆椾復鏃跺彉閲?/span>
//闅忔満鎶藉彇鎺変袱涓暟
document.write("鎶芥帀鐨勭1涓暟鏄細"+ar.splice(Math.floor(Math.random()*ar.length),1))
document.write("<br>鎶芥帀鐨勭2涓暟鏄細"+ar.splice(Math.floor(Math.random()*ar.length),1))
//鎵撲貢欏哄簭
ar.sort(function(){return Math.random()-.8})
//浣跨敤浜?涓復鏃跺彉閲?/span>
var t1=0,t2=0,t3;
for(t3=ar.length-1;t3>=0;t3--){
t1=t1+ar[t3];
t2=t2+(t3+1)*(t3+1)-ar[t3]*ar[t3];
}
t2=t2+n*n*2-n*2+1;
document.write("<br>璁$畻寰楀埌涓や釜鏁版槸錛?lt;br>"+(((n+1)*n/2-t1)+Math.sqrt(2*(t2)-((n+1)*n/2-t1)*((n+1)*n/2-t1)))/2+"<br>"+(((n+1)*n/2-t1)-Math.sqrt(2*(t2)-((n+1)*n/2-t1)*((n+1)*n/2-t1)))/2)
//-->
</SCRIPT>
</BODY>
</HTML>
]]>
Problem Statement
聽聽聽聽
There are three stacks of crates - two of them outside of the warehouse, and one inside the warehouse. We have a crane that can move one crate at a time, and we would like to move all of the crates to the stack inside the warehouse. A heavier crate can never be stacked on top of a lighter crate, and all three initial stacks obey that rule.
Definition
聽聽聽聽
Class:
CraneWork
Method:
moves
Parameters:
int[], int[], int[]
Returns:
int
Method signature:
int moves(int[] stack1, int[] stack2, int[] warehouse)
(be sure your method is public)
聽聽聽聽
Constraints
-
stack1, stack2, and warehouse will each contain between 0 and 20 elements, inclusive.
-
The total number of elements in the three stacks will be between 1 and 20, inclusive.
-
Each element in the three stacks will be between 1 and 200, inclusive.
-
stack1, stack2, and warehouse will each be in non-decreasing order.
Examples
0)
聽聽聽聽
{3,50}
{}
{1,2,50,50,50}
Returns: 12
Move 3 to stack2, 1 to stack1, 2 to stack2, 1 to stack2, 50 to warehouse, 1 to warehouse, 2 to stack1, 1 to stack1, 3 to warehouse, 1 to stack2, 2 to warehouse, 1 to warehouse.
1)
聽聽聽聽
{50}
{50}
{10,20,30}
Returns: 17
Start by moving 50 from stack2 to stack1. It then takes 7 moves to transfer the 10,20,30 to stack 2, 2 moves to transfer the 2 50's to the warehouse, and 7 more to transfer the 10,20,30 to the warehouse.
2)
聽聽聽聽
{}
{}
{2,5,6,7}
Returns: 0
All the crates are already in the warehouse.
3)
聽聽聽聽
{1,2,3}
{}
{}
Returns: 7
Move 1 from stack1 to warehouse, 2 from stack1 to stack2, 1 from warehouse to stack2, 3 from stack1 to warehouse, 1 from stack2 to stack1, 2 from stack2 to warehouse, 1 from stack1 to warehouse.
]]>
Problem Statement
聽聽聽聽
Definition
聽聽聽聽
Class:
MaximalPalindromeSubstrings
Method:
countMaximalPalindromeSubstrings
Parameters:
String[]
Returns:
int
Method signature:
int countMaximalPalindromeSubstrings(String[] str)
(be sure your method is public)
聽聽聽聽
Constraints
-
str will contain between 1 and 50 elements, inclusive.
-
Each element of str will contain between 1 and 50 characters, inclusive.
-
Each character of each element of str will be a lowercase letter ('a'-'z').
Examples
0)
聽聽聽聽
{"acdadc"}
Returns: 2
The example from the problem statement.
1)
聽聽聽聽
{"ababab"}
Returns: 2
The two maximal palindrome substrings here are "ababa" and "babab".
2)
聽聽聽聽
{"aaaa","bbb","axxx"}
Returns: 3
Remember to use the whole input!
3)
聽聽聽聽
{"abacabbacaacdbdcacxcbbbbcabababacccbazhhaahh"}
Returns: 14
]]>
Problem Statement
聽聽聽聽
You want to send a group of salespeople from location 0 to location 1, but no two of them can travel through the same location (other than 0 and 1). This removes the possibility of trying to sell a customer the same product twice. Character j of element i (both 0-based) of adj denotes whether locations i and j are connected by a symmetric link ('1' for connected, '0' otherwise). Return the greatest number of salespeople that can be sent. The constraints will guarantee that locations 0 and 1 do not share a link.
Definition
聽聽聽聽
Class:
SalesRouting
Method:
howMany
Parameters:
String[]
Returns:
int
Method signature:
int howMany(String[] adj)
(be sure your method is public)
聽聽聽聽
Constraints
-
adj will contain between 3 and 12 elements, inclusive.
-
Each element of adj will contain exactly N characters, where N is the number of elements in adj.
-
Each character in adj will be '0' (zero) or '1' (one).
-
Character i of element j of adj will be the same as character j of element i.
-
Character i of element i of adj will be '0'.
-
Character 1 of element 0 of adj will be '0'.
Examples
0)
聽聽聽聽
{
"001",
"001",
"110"
}
Returns: 1
We can send a single salesperson from location 0 to location 2, and finally to location 1.
1)
聽聽聽聽
{
"0010",
"0010",
"1100",
"0000"
}
Returns: 1
Same as before, but now there is an isolated location 3.
2)
聽聽聽聽
{
"001100",
"000001",
"100010",
"100010",
"001101",
"010010"
}
Returns: 1
The only location that is directly connected to location 1 is 5, so only 1 salesperson can be sent.
3)
聽聽聽聽
{
"001111",
"001111",
"110000",
"110000",
"110000",
"110000"
}
Returns: 4
4)
聽聽聽聽
{
"00000",
"00000",
"00000",
"00000",
"00000"
}
Returns: 0
]]>
Problem Statement
Definition
Class:
SecretSum
Method:
countPossible
Parameters:
String, String, String
Returns:
int
Method signature:
int countPossible(String num1, String num2, String result)
(be sure your method is public)
Constraints
-
num1, num2, and result will each contain exactly 3 uppercase letters ('A' - 'Z').
Examples
0)
"AAA"
"BBB"
"CCC"
Returns: 32
1)
"ABB"
"DEE"
"TTT"
Returns: 112
2)
"ABC"
"ABA"
"ACC"
Returns: 0
Leading zeroes are not allowed.
3)
"AAA"
"CDD"
"BAA"
Returns: 32
4)
"TEF"
"FET"
"AAA"
Returns: 12
5)
"ABC"
"ABC"
"BCE"
Returns: 5
We can have the following 5 sums: 124 + 124 = 248
125 + 125 = 250
249 + 249 = 498
374 + 374 = 748
375 + 375 = 750
6)
"AAA"
"AAA"
"BBB"
Returns: 4
We can have the following 4 sums: 111 + 111 = 222
222 + 222 = 444
333 + 333 = 666
444 + 444 = 888
]]>
Problem Statement
Definition
Class:
FactorialSystem
Method:
convert
Parameters:
int
Returns:
int
Method signature:
int convert(int num)
(be sure your method is public)
Notes
-
n! = 1 * 2 * ... * n
Constraints
-
num will be between 1 and 3628799 (10!-1), inclusive.
Examples
0)
1
Returns: 1
1)
24
Returns: 1000
24 = 4!
2)
153
Returns: 11111
153 = 1! + 2! + 3! + 4! + 5!.
3)
133
Returns: 10201
4)
3628799
Returns: 987654321
Largest possible input.
]]>
Problem Statement
Definition
Class:
RecurringNumbers
Method:
convertToFraction
Parameters:
String
Returns:
String
Method signature:
String convertToFraction(String decimalNumber)
(be sure your method is public)
Constraints
-
decimalNumber will have between 3 and 10 characters inclusive.
-
decimalNumber will contain only characters '0' - '9', '.', '(' and ')'.
-
The second character in decimalNumber will always be '.'.
-
There will be at most one '(' and ')' in decimalNumber.
-
'(' in decimalNumber will be followed by one or more digits ('0' - '9'), followed by ')'.
-
')' in decimalNumber will not be followed by any other character.
Examples
0)
"0.(3)"
Returns: "1/3"
0.(3) = 0.333... = 1/3
1)
"1.3125"
Returns: "21/16"
Note there are no recurring digits here, although we could write it as 1.3125(0) or 1.3124(9).
2)
"2.85(23)"
Returns: "14119/4950"
2.85(23) = 2.852323... = 285/100 + 23/9900 = 28238/9900 = 14119/4950. Make sure to reduce the fraction, as shown in the final step.
3)
"9.123(456)"
Returns: "3038111/333000"
4)
"0.111(1)"
Returns: "1/9"
5)
"3.(000)"
Returns: "3/1"
]]>
????
We have a sequence of integers, and we would like to remove all duplicate elements from this sequence. There may be multiple ways to perform this task. For example, given the sequence { 1, 2, 1, 3 }, we could end up with either { 1, 2, 3 } or { 2, 1, 3 } as the remaining sequence, depending on which duplicate 1 we remove from the original sequence. For this problem, we want to return the lexicographically first of of all possible remaining sequences. A sequence S1 comes before sequence S2 lexicographically if and only if S1 has a smaller value than S2 at the lowest index at which the two sequences differ (so, for example, { 1, 2, 3 } comes before { 2, 3, 1 }).
You will be given a int[] sequence. Return a int[] containing the sequence after all the duplicates are removed. See the examples for further clarification.
Definition
????
Class:
HardDuplicateRemover
Method:
process
Parameters:
int[]
Returns:
int[]
Method signature:
int[] process(int[] sequence)
(be sure your method is public)
????
Constraints
-
sequence will have between 1 and 50 elements, inclusive.
-
Each element of sequence will be between 1 and 1000, inclusive.
Examples
0)
????
{5, 6, 5, 1, 6, 5}
Returns: {1, 6, 5 }
There are six different ways to remove duplicates (remaining numbers are marked by '*'):
{ *5, *6, 5, *1, 6, 5},
{ *5, 6, 5, *1, *6, 5},
{ 5, *6, *5, *1, 6, 5},
{ 5, 6, *5, *1, *6, 5},
{ 5, *6, 5, *1, 6, *5},
{ 5, 6, 5, *1, *6, *5}.
The last variant is the lexicographically first.
1)
????
{3, 2, 4, 2, 4, 4}
Returns: {3, 2, 4 }
2)
????
{6, 6, 6, 6, 6, 6}
Returns: {6 }
3)
????
{1, 3, 2, 4, 2, 3}
Returns: {1, 2, 4, 3 }
4)
????
{5, 4, 1, 5}
Returns: {4, 1, 5 }
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
heights will have between 1 and 50 elements, inclusive.
-
Each element of heights will be between 1 and 1000, inclusive.
Examples
0)
????
{1,5,5,1,6,1}
Returns: 3
We can use rectangles with sizes 6x1, 2x4 and 1x5.
銆銆銆銆脳
銆脳脳銆脳
銆脳脳銆脳
銆脳脳銆脳
銆脳脳銆脳
脳脳脳脳脳脳
1)
????
{2,2,2,4,4}
Returns: 2
We can use a 3x2 rectangle and a 2x4 rectangle.
銆銆銆脳脳
銆銆銆脳脳
脳脳脳脳脳
脳脳脳脳脳
2)
????
{6,6,6,6,6,6}
Returns: 1
The structure is a rectangle.
3)
脳脳脳脳脳脳
脳脳脳脳脳脳
脳脳脳脳脳脳
脳脳脳脳脳脳
脳脳脳脳脳脳
脳脳脳脳脳脳
????
{71,44,95,16,10,80,12,17,98,61}
Returns: 10
It's impossible to use less than 10 rectangles.
4)
????
{100,100,97,100,100,100,97,98,99,99}
Returns: 5
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
row will contain between 1 and 50 characters, inclusive.
-
Each character in row will be either '.' or 'X'.
Examples
0)
????
"....."
Returns: 2
You can buy either tickets with indexes 1 and 2 or tickets with indexes 2 and 3.
1)
????
"......"
Returns: 2
2)
????
"..X..."
Returns: 3
You should buy tickets with indexes 3 and 4.
3)
????
".X.X..."
Returns: 4
4)
????
"X.XX.X"
Returns: -1
5)
????
".."
Returns: 0
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
When a stone is thrown across water, sometimes it will land on the water and bounce rather than falling in right away. Suppose that a stone is thrown a distance of n. On each successive bounce it will travel half the distance as the previous bounce (rounded down to the nearest integer). When it can not travel any further, it falls into the water. If, at any point, the stone lands on an obstruction rather than water, it will not bounce, but will simply deflect and fall into the water. Please look at the figure for further clarification (with black, red and green cells representing banks, obstructions and free water respectively). So, if the stone is thrown a distance 7, it will bounce and travel a distance of 3, then finally a distance of 1, having travelled a total distance of 11 (the green path in the figure). If a stone is thrown a distance of 8, it will reach the opposite bank, and if thrown at distances of 2 or 6 it will hit an obstruction during its travel. These are the three red paths in the figure.
You are given a String water. An 鈥榅鈥?represents an obstruction, while a 鈥?鈥?BR>represents water free from obstruction. You are to return an int representing
the maximum distance a stone can travel and finally fall in the water, without
hitting any obstructions, and without reaching the opposite bank (going beyond
the end of the string). You may choose any initial distance for the throw,
which starts from the left side of the string. A distance of 1 is the first
character of the string, etc. If no initial throw will result in the stone
landing in the water without hitting an obstruction, return 0.
緇欎簣涓涓?String 杈撳叆錛歸ater. 鍏跺唴鈥橷'瀛楃浠h〃紺佺煶錛屸?鈥?浠h〃鏃犵鐭蟲按闈€備綘鐨勭▼搴?BR>榪斿洖涓涓暣鏁癷nt錛岃〃紺鴻鐭沖ご鍦ㄦ渶緇堣惤鍏ユ按涓殑鎯呭喌涓嬭繍琛岀殑鎬繪渶澶ц窛紱伙紝瑙︾銆佹挒宀哥殑
鎯呭艦閮藉繀欏繪帓闄ゃ傚叾涓挒宀歌〃寰佷負 (瀛楃涓茶闂秺涓婄晫). 浣犲彲浠ラ夋嫨浠諱綍鍒濆鐨勬姇鎺瘋窛紱?BR>錛屽嚭鍙戠偣涓哄瓧絎︿覆鏈宸︿晶銆傝窛紱諱負1鍒欐姷杈懼瓧絎︿覆鐨勭涓涓瓧絎︼紝渚濇綾繪帹銆傚鏋滄病鏈夋姇鎺?BR>璺濈錛岀煶澶磋褰撲綔鐩存帴鍏ユ按錛岃繑鍥為噺涓?銆?/P>
瀹氫箟錛?/P>
Class:
SkipStones
Method:
maxDistance
Parameters:
String
Returns:
int
Method signature:
int maxDistance(String water)
(紜繚浣犵殑鍑芥暟涓哄叕鍏辯被鍨?public)
娉細
紺佺煶澶勫湪姘撮潰錛屾墍浠ヤ笉瀛樺湪鐭沖ご鍏ユ按鍚庢挒紺佺殑鎯呭艦銆?/P>
闄愬埗鏉′歡錛?
water 瀛楃涓插寘鍚?鍒?0涓厓绱燵鍗崇鐭蟲垨姘撮潰]錛?銆?0鍖呭惈鍦ㄥ唴銆?BR>water鐨勬瘡涓厓绱犲寘鍚?鍒?0涓瓧絎? 1銆?0鍖呭惈鍦ㄥ唴銆?BR>water鐨勬瘡涓厓绱犵殑姣忎釜瀛楃瑕佷箞鏄橷'錛岃涔堟槸 鈥?鈥?
嫻嬭瘯渚嬪瓙
0)
鈥?.X鈥?.X鈥︹?BR>榪斿洖: 11
璇ヤ緥姝e棰樼洰涓紙緇胯壊杞ㄨ抗錛夋墍鍥劇ず銆?/P>
1)
鈥溾鈥︹?BR>榪斿洖: 3
鍋囧娌℃湁璇ョ鐭?鍙互鎵斾竴璺濈4,浠庤屾昏窛紱諱負7銆備絾鍦ㄦ湁紺佺煶鎯呭艦涓嬶紝鏈浣沖垯鏄墧鍑鴻窛紱?
錛屽啀璺?鑰屽仠姝€?/P>
2)
鈥溾?X鈥?X鈥XXX.X鈥?.鈥?BR>榪斿洖: 22
12 + 6 + 3 + 1 = 22, 涓烘渶浣崇粨鏋?
3)
鈥淴XXXXXX.XXX.X..鈥?BR>榪斿洖: 15
Constraints
-
baskets will be between 1 and 5, inclusive.
-
capacity will be between 1 and 20, inclusive.
-
balls will be between 1 and 100, inclusive.
Examples
0)
????
2
20
2
Returns: 3
The example from the problem statement.
1)
????
3
20
1
Returns: 3
We have only 1 ball, so we must choose which of the three baskets to place it in.
2)
????
3
20
2
Returns: 6
We can place both balls in the same basket (3 ways to do this), or one ball in each of two baskets (3 ways to do this).
3)
????
1
5
10
Returns: 0
We have more balls than our basket can hold.
4)
????
4
5
10
Returns: 146
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
cityMap will contain between 1 and 50 elements, inclusive.
-
Each element of cityMap will contain between 1 and 50 characters, inclusive.
-
Each element of cityMap will contain the same number of characters.
-
Each character of each element of cityMap will be 'B', 'X', or '.'.
-
There will be exactly one 'X' character in cityMap.
-
walkingDistance will be between 1 and 100, inclusive.
Examples
0)
????
{"...B.",
".....",
"..X.B",
".....",
"B...."}
3
Returns: 2
You can reach the bus stop at the top (3 units away), or on the right (2 units away). The one in the lower left is 4 units away, which is too far.
1)
????
{"B.B..",
".....",
"B....",
".....",
"....X"}
8
Returns: 3
A distance of 8 can get us anywhere on the map, so we can reach all 3 bus stops.
2)
????
{"BBBBB",
"BB.BB",
"B.X.B",
"BB.BB",
"BBBBB"}
1
Returns: 0
Plenty of bus stops, but unfortunately we cannot reach any of them.
3)
????
{"B..B..",
".B...B",
"..B...",
"..B.X.",
"B.B.B.",
".B.B.B"}
3
Returns: 7
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
grid will contain between 1 and 50 elements, inclusive.
-
Each element of grid will contain between 1 and 50 uppercase ('A'-'Z') letters, inclusive.
-
Each element of grid will contain the same number of characters.
-
find will contain between 1 and 50 uppercase ('A'-'Z') letters, inclusive.
Examples
0)
????
{"ABC",
"FED",
"GHI"}
"ABCDEFGHI"
Returns: 1
There is only one way to trace this path. Each letter is used exactly once.
1)
????
{"ABC",
"FED",
"GAI"}
"ABCDEA"
Returns: 2
Once we get to the 'E', we can choose one of two directions for the final 'A'.
2)
????
{"ABC",
"DEF",
"GHI"}
"ABCD"
Returns: 0
We can trace a path for "ABC", but there's no way to complete a path to the letter 'D'.
3)
????
{"AA",
"AA"}
"AAAA"
Returns: 108
We can start from any of the four locations. From each location, we can then move in any of the three possible directions for our second letter, and again for the third and fourth letter. 4 * 3 * 3 * 3 = 108.
4)
????
{"ABABA",
"BABAB",
"ABABA",
"BABAB",
"ABABA"}
"ABABABBA"
Returns: 56448
There are a lot of ways to trace this path.
5)
????
{"AAAAA",
"AAAAA",
"AAAAA",
"AAAAA",
"AAAAA"}
"AAAAAAAAAAA"
Returns: -1
There are well over 1,000,000,000 paths that can be traced.
6)
????
{"AB",
"CD"}
"AA"
Returns: 0
Since we can't stay on the same cell, we can't trace the path at all.
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
keystrokes will be contain between 1 and 50 'L', 'R', 'H', and 'E' characters, inclusive.
-
N will be between 1 and 100, inclusive.
Examples
0)
????
"ERLLL"
10
Returns: 7
First, we go to the end of the line at position 10. Then, the right-arrow does nothing because we are already at the end of the line. Finally, three left-arrows brings us to position 7.
1)
????
"EHHEEHLLLLRRRRRR"
2
Returns: 2
All the right-arrows at the end ensure that we end up at the end of the line.
2)
????
"ELLLELLRRRRLRLRLLLRLLLRLLLLRLLRRRL"
10
Returns: 3
3)
????
"RRLEERLLLLRLLRLRRRLRLRLRLRLLLLL"
19
Returns: 12
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
娌℃湁闅懼害
Constraints
-
s will contain between 1 and 50 digits, inclusive.
Examples
0)
????
"435245019"
Returns: {"435", "245", "019" }
The example above.
1)
????
"9"
Returns: {"9" }
2)
????
"0123456789"
Returns: { }
This input has 10 digits, and 10 is not a perfect square.
3)
????
"3357002966366183191503444273807479559869883303524"
Returns: {"3357002", "9663661", "8319150", "3444273", "8074795", "5986988", "3303524" }
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
灞鎼炵瑧鐨勯鐩傝繖嬈′腑鍥介敠鏍囪禌鐨勬ā鎷熼姣旇搗涓婃涓滀簹鐨勫樊鐨勫お榪滀簡銆傝В涓涓惂錛?BR>
Notes
-
The cursor only paints the canvas if it moves (see example 1).
Constraints
-
commands will contain between 1 and 50 elements, inclusive.
-
Each element of commands will be formatted as either "LEFT" or "FORWARD x" (quotes for clarity only), where x is an integer between 1 and 19, inclusive, with no extra leading zeros.
-
When executing the commands in order, the cursor will never leave the 20 x 20 pixel canvas.
Examples
0)
{"FORWARD 19", "LEFT", "FORWARD 19", "LEFT", "FORWARD 19", "LEFT", "FORWARD 19"}
Returns:
{"XXXXXXXXXXXXXXXXXXXX",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"X..................X",
"XXXXXXXXXXXXXXXXXXXX" }
This sequence of commands draws a 20 x 20 outline of a square. The cursor is initially at (0, 0) pointing straight down. It then travels to (0, 19) after the first FORWARD command, painting each pixel along its path with a '*'. It then rotates 90 degrees left, travels to (19, 19), rotates 90 degrees left, travels to (19, 0), rotates 90 degrees left, and finally travels back to (0, 0).
1)
{"LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "LEFT"}
Returns:
{"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"...................." }
The cursor spins round and round, but never actually paints any pixels. The result is an empty canvas.
2)
{"FORWARD 1"}
Returns:
{"X...................",
"X...................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"....................",
"...................." }
Going forward by one pixel creates a line that is 2 pixels long because both the start and end points are painted.
3)
{"LEFT", "FORWARD 19", "LEFT", "LEFT", "LEFT",
"FORWARD 18", "LEFT", "LEFT", "LEFT", "FORWARD 17",
"LEFT", "LEFT", "LEFT", "FORWARD 16", "LEFT",
"LEFT", "LEFT", "FORWARD 15", "LEFT", "LEFT", "LEFT",
"FORWARD 14", "LEFT", "LEFT", "LEFT", "FORWARD 13",
"LEFT", "LEFT", "LEFT", "FORWARD 12", "LEFT", "LEFT",
"LEFT", "FORWARD 11", "LEFT", "LEFT", "LEFT", "FORWARD 10",
"LEFT", "LEFT", "LEFT", "FORWARD 9", "LEFT", "LEFT",
"LEFT", "FORWARD 8", "LEFT", "LEFT", "LEFT", "FORWARD 7"}
Returns:
{"XXXXXXXXXXXXXXXXXXXX",
"...................X",
"..XXXXXXXXXXXXXXXX.X",
"..X..............X.X",
"..X.XXXXXXXXXXXX.X.X",
"..X.X..........X.X.X",
"..X.X.XXXXXXXX.X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.X........X.X.X",
"..X.X.XXXXXXXXXX.X.X",
"..X.X............X.X",
"..X.XXXXXXXXXXXXXX.X",
"..X................X",
"..XXXXXXXXXXXXXXXXXX",
"...................." }
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
emu瑙g瓟錛?/P>
Class: | SongRenamer |
Method: | rename |
Parameters: | String[], String[], String[], String[], String |
Returns: | String[] |
Method signature: | String[] rename(String[] artists, String[] albums, String[] tracks, String[] titles, String format) |
(be sure your method is public) |
| |||||
Returns: {"Marvin Gaye - Here My Dear-09-Annas Song", "Marvin Gaye - Whats Going On-7-Right On" } | |||||
| |||||
Returns: {"Number Two. Something_McLemore Avenue_(Something)" } | |||||
|
| |||||
Returns: {"You Cant Do That (You Cant Do That) You Cant Do That", "You Cant Do That (You Cant Do That) You Cant Do That", "You Cant Do That (You Cant Do That) You Cant Do That" } | |||||
| |||||
Returns: {" s p a c e s ._ The Leading Spaces_ (Trailing Space )" } | |||||
|
| |||||
Returns: {"()-(). " } | |||||
|
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Class: | Crop |
Method: | crop |
Parameters: | String[], String[] |
Returns: | String[] |
Method signature: | String[] crop(String[] image, String[] crops) |
(be sure your method is public) |
| ||
Returns: {"X.", ".." } | ||
|
| ||
Returns: {"X.X.X.X.X.X.X.X", ".X.X.X.X.X.X.X." } | ||
|
| ||
Returns: {"." } | ||
| ||
Returns: {".X..X.", "......", "X....X", ".XXXX." } | ||
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
url will contain between 1 and 50 characters, inclusive.
-
Each '%' in the input will be followed by a hexadecimal value between 20 (hex) and 7E (letters will be uppercase).
-
Each character in the input will have ASCII value between 32 and 126, inclusive.
Examples
0)
????
"http://www.%20%40%20%40%20.com/%25"
Returns: "http://www. @ @ .com/%"
"%20" is the escape sequence for ' ', while "%40" stands for '@' and "%25" stands for '%'.
1)
????
"%20%21%22%23%24%25%26%27%28"
Returns: " !\"#$%&'("
2)
????
"%48%65%6C%6C%6F%20%57%6F%72%6C%64%21"
Returns: "Hello World!"
3)
????
"%2525"
Returns: "%25"
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
The city has received enough funds to build one additional fire station, and the mayor has decided that it is most important to minimize the average distance between a person and the closest fire station to that person. The metric used to determine the distance between two locations in the city is the Manhattan distance between the two blocks on which the locations are situated. The Manhattan distance between two blocks (r1, c1) and (r2, c2) is |r1-r2|+|c1-c2| (the vertical bars represent absolute value). Determine the block on which the new station should be built and return its row and column formatted as "r c" (quotes for clarity only). The return String should contain no extra leading zeros. If multiple blocks are equally optimal, return the one with the lowest row, and if multiple optimal blocks have the same lowest row, return the one among them with the lowest column. If adding an additional fire station would not reduce the average distance between a person and the closest fire station to that person, return the empty String ("").
Definition
????
Class:
NewStation
Method:
location
Parameters:
String[], String[]
Returns:
String
Method signature:
String location(String[] grid, String[] stations)
(be sure your method is public)
????
Constraints
-
grid will contain between 1 and 20 elements, inclusive.
-
Each element of grid will contain between 1 and 20 characters, inclusive.
-
Each element of grid will contain exactly the same number of characters.
-
Each element of grid will contain only digits ('0'-'9').
-
At least one character in grid will be non-zero.
-
stations will contain between 1 and 10 elements, inclusive.
-
Each element of stations will be formatted as "r c" (quotes for clarity only), where r and c are each integers between 0 and 19, inclusive, with no leading zeros.
-
Each element of stations will represent a location within the boundaries of grid.
Examples
0)
????
{"111",
"111",
"111"}
{"1 1"}
Returns: "0 1"
There's an existing station at (1, 1) and each block contains exactly the same number of people. Placing a new station at either (0, 1), (1, 0), (1, 2), or (2, 1) would minimize the average distance. (0, 1) is chosen since it has the lowest row. Adding the new station reduces the average distance from approximately 1.33 to 1.0. The distance from each block to the nearest station becomes:
101
101
212
1)
????
{"111",
"111",
"111"}
{"0 0", "0 1", "0 2",
"1 0", "1 1", "1 2",
"2 0", "2 1", "2 2"}
Returns: ""
There's a fire station on every block, so adding a new station would not reduce the average distance.
2)
????
{"2312",
"0233"}
{"1 3"}
Returns: "0 1"
Placing a fire station at (0, 1) would make the average distance 0.625.
3)
????
{"2312",
"0233"}
{"1 1", "1 1"}
Returns: "0 3"
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
sales will contain between 1 and 50 elements, inclusive.
-
Each element of sales will be formatted as described in the problem statement, with at least 1 product and at most 50 characters.
-
CLIENT_ID and each PRODUCT_* will contain between 1 and 10 uppercase letters ('A'-'Z'), inclusive.
-
Each CNT_* will represent an integer between 1 and 999, inclusive, with no leading zeros.
-
client will contain between 1 and 10 uppercase letters ('A'-'Z'), inclusive.
-
product will contain between 1 and 10 uppercase letters ('A'-'Z'), inclusive.
Examples
0)
????
{"BOB 1 SHOE",
"JOHN 2 SHOE",
"BOB 3 SHOE 1 HORSE"}
"BOB"
"SHOE"
Returns: 4
1)
????
{"MEG 1 TV 1 VCR 10 DVD 3 DVD",
"HARRY 2 TV 6 DVD",
"MEG 11 DVD",
"MEG 2 TV",
"HARRY 101 DVD"}
"MEG"
"DVD"
Returns: 24
Note that "DVD" occurs twice in the first element.
2)
????
{"GEORGE 999 PETS"}
"BOB"
"SHOE"
Returns: 0
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
collection will contain between 1 and 50 elements, inclusive.
-
Each element of collection will be formatted as described in the problem statement.
-
Each element of collection will contain between 7 and 50 characters, inclusive.
-
Each genre, artist, album, and song in collection will contain between 1 and 20 characters, inclusive.
-
collection will contain no duplicate elements.
-
filterInfo will contain between 1 and 4 elements, inclusive.
-
Each element of filterInfo will be formatted as described in the problem statement.
-
Each value in filterInfo will contain between 1 and 20 characters, inclusive.
Examples
0)
????
{"jazz-joe pass-virtuoso-cherokee",
"rock-led zeppelin-ii-lemon song",
"country-dwight yoakam-long way home-things change",
"metal-iron maiden-powerslave-aces high",
"pop-supremes-more hits-ask any girl",
"rock-faith no more-angel dust-rv",
"jazz-chuck mangione-feels so good-feels so good",
"rock-van halen-ii-spanish fly"}
{"genre=rock", "album=ii"}
Returns: {"rock-led zeppelin-ii-lemon song", "rock-van halen-ii-spanish fly" }
This filter returns all the rock songs from albums with the title "ii".
1)
????
{"rock-jimi hendrix-axis bold as love-little wing",
"rock-cars-cars-moving in stereo",
"rock-jimi hendrix-electric ladyland-gypsy eyes",
"blues-albert collins-ice pickin-ice pick",
"rock-jimi hendrix-axis bold as love-bold as love",
"rock-jimi hendrix-axis bold as love-exp"}
{"artist=jimi hendrix", "album=axis bold as love"}
Returns:
{"rock-jimi hendrix-axis bold as love-little wing",
"rock-jimi hendrix-axis bold as love-bold as love" }
This filter returns all the songs that are from the album "axis bold as love" by the artist "jimi hendrix". The last element in the collection is not returned because there are two spaces between "jimi" and "hendrix".
2)
????
{"rock-ozzy osbourne-blizzard of ozz-dee",
"rock-marvelous three-hey album-let me go",
"rock-cheap trick-in color-downed"}
{"genre=soul"}
Returns: { }
There is no soul music in this collection, so an empty String[] is returned.
3)
????
{"country-topcoder-the country album-twangy",
"rock-topcoder-the rock album-rockin",
"jazz-topcoder-the jazz album-jazzy",
"soul-topcoder-the soul album-soulful",
"metal-topcoder-the metal album-thrash"}
{"artist=topcoder", "genre=jazz", "album=the jazz album", "song=jazzy"}
Returns: {"jazz-topcoder-the jazz album-jazzy" }
4)
????
{"pop-jackson five-abc-the love you save",
"rock-ac dc-powerage-riff raff"}
{"genre=pop", "genre=rock"}
Returns: { }
No single element of collection can represent more than one genre, so this filter returns an empty String[].
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Given the String[] macro, perform all the operations in the macro in order and return the final state of the image layers as a String[]. The String[] should contain exactly the same number of elements as there are layers in the final image, and each element i should correspond to the ith layer. Each element of the String[] should be a single space delimited list of the filenames contained in that layer. The filenames should be sorted in alphabetical order within each layer.
Definition
????
Class:
ImageLayers
Method:
contents
Parameters:
String[]
Returns:
String[]
Method signature:
String[] contents(String[] macro)
(be sure your method is public)
????
Constraints
-
macro will contain between 1 and 50 elements, inclusive.
-
Each element of macro will be formatted as either "OPEN filename" or "MERGE layer1-layer2".
-
Each filename in macro will contain between 1 and 15 lowercase letters ('a'-'z'), inclusive.
-
Each layer1 and layer2 in macro will be integers between 0 and n-1, inclusive, with no leading zeros, where n is the number of layers that exist in the image immediately before the command is executed.
-
Within each element of macro that represents a merge command, layer1 will be less than layer2.
-
The first element of macro will be an OPEN command.
Examples
0)
????
{"OPEN background",
"OPEN aone",
"OPEN atwo",
"OPEN foreground",
"MERGE 0-2",
"OPEN border"}
Returns: {"aone atwo background", "foreground", "border" }
After the first four commands in macro are executed, the layers are (from bottom to top):
0. background 1. aone 2. atwo 3. foreground
The merge command combines the bottom three layers into a single layer. There are now only two layers (from bottom to top):
0. background aone atwo 1. foreground
Finally, one last file is opened and placed in a new layer on top. The final return value contains the filenames within each layer sorted alphabetically:
0. aone atwo background 1. foreground 2. border
1)
????
{"OPEN sky",
"OPEN clouds",
"OPEN ground",
"MERGE 0-1",
"OPEN grass",
"MERGE 0-2",
"OPEN trees",
"OPEN leaves",
"OPEN birds",
"MERGE 1-2",
"MERGE 0-1"}
Returns: {"clouds grass ground leaves sky trees", "birds" }
2)
????
{"OPEN a", "OPEN b", "OPEN a", "OPEN a", "MERGE 0-3"}
Returns: {"a a a b" }
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Constraints
-
size will be between 10 and 100, inclusive.
-
disk will contain between 1 and 12 elements, inclusive.
-
Each element of disk will contain between 1 and 50 characters, inclusive.
-
Each element of disk will be a single-space delimited list of integers, without extraneous leading zeros.
-
Each integer in disk will be between 0 and size-1, inclusive.
-
No integer will be appear more than once in disk.
Examples
0)
????
{"3 4 5 6 8 9 10","17 16 15"}
20
Returns: 5
We can defrag the first file by moving the contents of sector 8 to sector 7, then 9 to 8, and finally 10 to 9. The second file can be defragged in a number of ways by moving the contents of two sectors, for a total of 5.
1)
????
{"1 2 3 5 4 6 7 8"}
10
Returns: 2
Here we can take advantage of the fact that we have enough memory to hold two sectors worth of data. First, load the contents of sectors 4 and 5 into memory. Now, simply write the data back in the reverse order.
2)
????
{"1 3 5 7","0 2 4 8","6 9"}
100
Returns: 7
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
Notes
-
While the input may have extraneous leading zeros, your return should not.
Constraints
-
rules will contain between 1 and 50 elements, inclusive.
-
Each element of rules will be formatted as described in the problem statement.
-
packets will contain between 1 and 50 elements, inclusive.
-
Each element of packets will be formatted as described in the problem statement.
-
Each of the four numbers in an IP address, or a number range in an IP address will be between 0 and 255, inclusive.
-
Each port or number in a port range will be between 1 and 65535 inclusive.
-
In any <NUMBER_RANGE> with two numbers, <LOWER_LIMIT> will be less than or equal to <UPPER_LIMIT>.
Examples
0)
????
{"FORWARD 192.168.000.* 001-100 192.168.0.10",
"FORWARD 192.168.0.1 80 10.10.95.184 8080",
"ACCEPT 192.168.*.* 25",
"REJECT 192.168.5.38 *"}
{"192.168.0.43 80",
"00192.00168.000.001 00080",
"192.168.0.1 110",
"192.168.1.73 80",
"192.168.1.73 25",
"206.26.210.5 53",
"192.168.5.38 25"
}
Returns:
{ "192.168.0.10:80",
"10.10.95.184:8080",
"REJECT",
"REJECT",
"ACCEPT",
"REJECT",
"REJECT" }
Packet 0 matches rule 0, and gets forwarded according to that rule. Packet 1 matches both rules 0 and 1, so rule 1 is applied. Packets 2, 3, and 5 don't match any rules, so they are rejected. Packet 4 matches rule 2, and is therefore accepted. Packet 6 matches rules 2 and 3, so it gets rejected (rule 3 is applied).
1)
????
{"FORWARD *.*.*.* * 192.168.0.1"}
{"213.148.161.82 9484",
"172.230.108.145 16627",
"122.141.122.130 46874",
"241.145.145.77 26390",
"139.97.106.125 35305",
"244.131.151.77 26390"}
Returns:
{ "192.168.0.1:9484",
"192.168.0.1:16627",
"192.168.0.1:46874",
"192.168.0.1:26390",
"192.168.0.1:35305",
"192.168.0.1:26390" }
2)
????
{"REJECT *.20-252.114-157.36-91 13171-54085",
"ACCEPT *.*.73-180.* *",
"FORWARD 55.63.173.239 * 168.154.33.25",
"REJECT *.72-73.*.48-191 *",
"REJECT 20.51.*.* 4579",
"ACCEPT 70-166.*.*.86-182 *",
"REJECT 88-190.*.119-157.* 3316-27844",
"FORWARD *.52-221.134-250.66-207 * 116.94.120.82"}
{"203.11.104.45 44072",
"154.92.128.87 30085",
"20.51.68.55 4579",
"177.73.138.69 14319",
"112.65.145.82 26287",
"55.63.173.239 45899"}
Returns:
{ "ACCEPT",
"ACCEPT",
"REJECT",
"116.94.120.82:14319",
"116.94.120.82:26287",
"168.154.33.25:45899" }
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.