摘要: 题目: Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we 阅读全文
posted @ 2019-09-11 16:48 silentteller 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 题目: Count the number of prime numbers less than a non-negative number, n. Example: 分析: 统计所有小于非负整数 n 的质数的数量。 这里使用埃拉托斯特尼筛法。要得到自然数n以内的全部素数,必须把不大于√n的所有素数的 阅读全文
posted @ 2019-09-11 16:05 silentteller 阅读(385) 评论(0) 推荐(0) 编辑