如果1-100 都存在,隻有一個重複的, 那把101個加起來減去5050,就是重複的那個。
所有跟帖:
•
答案正確,time and space complexity 都是 O(1)
-兄貴-
♂
(0 bytes)
()
04/02/2023 postreply
14:51:53
•
問一下: codeforces多少分可以寫到申請裏呀?
-zhucekunnan-
♀
(0 bytes)
()
04/02/2023 postreply
15:26:33
•
我覺得Codeforces等級分不要寫在申請裏
-兄貴-
♂
(224 bytes)
()
04/02/2023 postreply
15:32:51
•
thank you!
-zhucekunnan-
♀
(0 bytes)
()
04/02/2023 postreply
15:35:54
•
嗯。巧妙;感覺像智力測驗題,要從編程出發,一般人肯定先想到Loop來比較。
-Rono-
♂
(0 bytes)
()
04/02/2023 postreply
15:53:15
•
對,非常好的麵試題,考的就是智力
-兄貴-
♂
(0 bytes)
()
04/02/2023 postreply
16:08:07