测试场景说明
- 此场景在已知一个(x,y)坐标点位,求其周围500米范围内,按照与该点距离由小到大排列之后的所有点位
头文件定义
#include <stdio.h>
#include <sys/time.h> // for gettimeofday()
#include <iostream> // for cout
#include <stdint.h> // for uint64_t
#include <map> // for map
#include <vector> // for vector
#include <math.h> // for sqrt()、pow()
#include <algorithm> // for sort()、stable_sort()
宏定义:
#define DISTANCE 500
变量和函数的定义
- 定义获取系统微秒级时间函数:
uint64_t getUSeconds()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec*1000000+tv.tv_usec;
}
- 定义相关变量:
struc