如果1-100 都存在,只有一个重复的, 那把101个加起来减去5050,就是重复的那个。
所有跟帖:
• 他只说了连续的,没说是从1开始 -avw- ♀ (0 bytes) () 04/02/2023 postreply 14:45:17
• 答案正确,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