Poj 1106 Transmitters 传送门 给出一个半圆,可以任意旋转,问这个半圆能够覆盖的最多点数. 我们枚举每一个点作为必然覆盖点,那么使用叉积看极角关系即可判断其余的点是否能够与其存在一个半圆内 import java.io.*; import java.util.*; public class Main { static class Point implements Comparable<Point> { double x, y; @Override public int co…
http://poj.org/problem?id=1106 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4488 Accepted: 2379 Description In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don…
The Fortified Forest Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 6198 Accepted: 1744 Description Once upon a time, in a faraway land, there lived a king. This king owned a small collection of rare and valuable trees, which had been…
链接: http://poj.org/problem?id=3977 题意: 给你n个数,n最大35,让你从中选几个数,不能选0个,使它们和的绝对值最小,如果有一样的,取个数最小的 思路: 子集个数共有2^n个,所以不能全部枚举,但是可以分为两部分枚举:枚举一半的所有情况,然后后一半二分即可: 代码: #include"bits/stdc++.h" #define N 45 using namespace std; typedef long long LL; int n; LL a[N…