這題就是給

一些數字,你要拼湊出最大的

遇到0結束

Input

4

123 124 56 90

5

123 124 56 90 9

5

9 9 9 9 9

0

Continue Reading

這題就是給

一些數字,你要拼湊出最大的

遇到0結束

Input

4

123 124 56 90

5

123 124 56 90 9

5

9 9 9 9 9

0

Continue Reading

題目簡單來說就是有很多個party要罷工

然後他們有個每隔3天霸一次、4天等等

然後題目會給一個區間,第一天就是星期一….

星期六日不上班,希望能夠求出這段時間扣掉假日

罷工實際損失的天數

題目表示區間最多3651天

party數不超過100個

Continue Reading

輸入兩個input程式會計算經過幾次進位

如果輸入0 0就會結束

例如

1 999 => 3 carry

123 456 No carry

Continue Reading

11006:Rank the Languages

Time Limit: 2 sec

Description

You might have noticed that English and Spanish are spoken in many areas all over the world. Now it would be nice to rank all languages according to the number of states where they are spoken.

Continue Reading

10502:Product of digits

Time Limit: 3 sec

Description

For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N .

Continue Reading

考拉茲臆測(Collatz conjecture)，又稱3n+1臆測

輸入一個正整數N，如果是奇數，就乘3+1

如果是偶數，就除2，最終就能夠得到1

例如10-5-16-8-4-2-1，長度為7

Continue Reading

The Problem

The “reverse and add” method is simple: choose a number, reverse its digits and add it to the original.

If the sum is not a palindrome (which means, it is not the same number from left to right and right to left),

repeat this procedure.

For example:

195 Initial number

591

—–

786

687

—–

1473

3741

—–

5214

4125

—–

9339 Resulting palindrome