原创 1028 List Sorting (25分)(測試點超時問題)

1028 List Sorting (25分) Excel can sort records according to any column. Now you are supposed to imitate this functi

原创 用位運算來實現字符串的比較

思想還是比較簡單的,直接上代碼 bool cmp(string a,string b) { if(a.size()!=b.size()) return fasle; int ans=0; for(int i=0;i<a.

原创 1046 Shortest Distance (20分) (含測試點2分析)

1046 Shortest Distance (20分) The task is really simple: given N exits on a highway which forms a simple cycle, you

原创 1073 Scientific Notation (20分)

1073 Scientific Notation (20分) Scientific notation is the way that scientists easily handle very large numbers or v

原创 1084 Broken Keyboard (20分)

1084 Broken Keyboard (20分) On a broken keyboard, some of the keys are worn out. So when you type some sentences, th

原创 1112 Stucked Keyboard (20分) (含測試點1分析)

1112 Stucked Keyboard (20分) On a broken keyboard, some of the keys are always stucked. So when you type some senten

原创 字符串乘方

字符串乘方 給定兩個字符串a和b,我們定義ab爲他們的連接。 例如,如果a=”abc” 而b=”def”, 則ab=”abcdef”。 如果我們將連接考慮成乘法,一個非負整數的乘方將用一種通常的方式定義:a0=””(空字符串),a

原创 最長公共字符串後綴

最長公共字符串後綴 給出若干個字符串,輸出這些字符串的最長公共後綴。 輸入格式 由若干組輸入組成。 每組輸入的第一行是一個整數N。 N爲0時表示輸入結束,否則後面會繼續有N行輸入,每行是一個字符串(字符串內不含空白符)。 每個字符

原创 平方矩陣 II

平方矩陣 II 輸入整數N,輸出一個N階的二維數組。 數組的形式參照樣例。 輸入格式 輸入包含多行,每行包含一個整數N。 當輸入行爲N=0時,表示輸入結束,且該行無需作任何處理。 輸出格式 對於每個輸入整數N,輸出一個滿足要求的N

原创 平方矩陣 III

平方矩陣 III 輸入整數N,輸出一個N階的二維數組M。 這個N階二維數組滿足M[i][j] = 2i+j。 具體形式可參考樣例。 輸入格式 輸入包含多行,每行包含一個整數N。 當輸入行爲N=0時,表示輸入結束,且該行無需作任何處

原创 1132 Cut Integer (20分) (浮點錯誤分析)

1132 Cut Integer (20分) Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits

原创 1100 Mars Numbers (20分)

1100 Mars Numbers (20分) People on Mars count their numbers with base 13: Zero on Earth is called “tret” on Mars. Th

原创 1069 The Black Hole of Numbers (20分)

1069 The Black Hole of Numbers (20分) For any 4-digit integer except the ones with all the digits being the same, if

原创 1077 Kuchiguse (20分)

1077 Kuchiguse (20分) The Japanese language is notorious for its sentence ending particles. Personal preference of s

原创 1036 Boys vs Girls (25分)

1036 Boys vs Girls (25分) This time you are asked to tell the difference between the lowest grade of all the male st