摘要: 题意:给定n, p, 求pow(p, 1/n)10955211NY_lv102109Accepted196K0MSC++192B2012-10-25 18:56:50View Code #include <iostream>#include <math.h>using namespace std;int main(){ double n, p; while (scanf("%lf %lf", &n, &p) !=EOF) { printf("%0.0lf\n", pow(p, 1/n)); } return 0;} 阅读全文
posted @ 2012-10-25 18:59 旅行的蜗牛 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题意: 海上有一些岛屿(数目为n),需要在岸边(x 轴)修建一些雷达站覆盖这些岛屿,雷达的覆盖范围是d , 求最少需要多少雷达。思路:求出每个岛屿能被雷达覆盖的,雷达可以放置的最左边和最右边位置,然后将每个岛屿按照左边的位置排序,放置雷达。10955167NY_lv101328Accepted300K47MSC++1092B2012-10-25 18:45:07View Code #include<iostream>#include<algorithm>#include<vector>#include<math.h>using namespace 阅读全文
posted @ 2012-10-25 18:50 旅行的蜗牛 阅读(136) 评论(0) 推荐(0) 编辑