
二分查找算法
coding__girl
这个作者很懒,什么都没留下…
展开
-
UVA 10706 Number Sequence
A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2 … Sk. Each group Sk consists of a sequence of positive integer nu原创 2017-09-23 18:27:28 · 272 阅读 · 0 评论 -
UVA 10539 Almost Prime
Almost prime numbers are the non-prime numbers which are divisible by only a single prime number. In this problem your job is to write a program which finds out the number of almost prime numbers withi原创 2017-09-23 19:04:21 · 382 阅读 · 0 评论 -
UVA 10077 The Stern-Brocot Number System
题意: 题目:给你一颗分数组成的二叉树,初始值是1/1,两边的边界分别是0/1与1/0,然后递归建立子树节点,每个子树的节点值为两边的边界值的分子之和比上分母之和,然后将新的值也加入边界值。用二分搜索法来写#include <iostream> using namespace std; void find(int lx,int ly,int rx,int ry,int X,int Y) {原创 2017-09-20 19:12:57 · 273 阅读 · 0 评论