1.3979 分數加減法 解法:按題目說明一步步地寫,最後注意求取最大公因數,約分求解,注意整數 2.2017 Speed Limit 描述:Bill 和Ted的裡程計壞了,但是他們有個可用的秒錶,所以他們可以記錄速度和行走的實際,但是這個秒錶記錄時間的方式有問題, Speed in miles perhour Total elapsed time in hours 20
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 解題思路:整數加1,需要考慮的是進位和最後的結果會不會多一位,比如99,999這樣的情況。 package leedcode;public
Problem A: 跑得比誰都快的IDrandom 眾所周知,IDrandom是一個跑得很快的dalao。然而由於種種不可告人的原因,直到今年他才能報名心愛的馬拉松。 某個晚上,他和他的妹子在東區體育場夜跑(噓),東區體育場是一個標準的400米田徑場。最初,IDrandom和他的妹子從同一個位置,沿著田徑場最內圈同時開始跑步,然而IDrandom巨巨跑得相當快,沒過多久IDrandom巨巨就跑遠了。
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 -> 6
1493. One Step from Happiness Time limit: 1.0 second Memory limit: 64 MB Vova bought a ticket in a tram of the 13th route and counted the sums of the first three and the last three digits of the ticket's number (the
醫院設定 Time Limit:10000MS Memory Limit:65536K Total Submit:107 Accepted:81 Case Time Limit:1000MS Description 設有一棵二叉樹(如右圖)。其中,圈中的數字表示結點中居民的人口。圈邊上數字表示結點編號,現在要求在某個結點上建立一個醫院,使所有居民所走的路程之和為最小,同時約定,相鄰接點之間的距離為1。如 右圖中,若醫院建在: 1處,則距離和=