搜索（BFS+DFS），图论（最小生成树，单源最短路径），计算几何（凸包）需要深入学习的东西太多了，没时间上这个Blog，尽量更新吧！！！！！记录一下！！

]]>

]]>

FZU的11题网络赛1个小时前落下帷幕，辉哥还是那么生猛，一人连A三题……Orz中！！

今天的C题目留下一大遗憾，貌似可以暴力过，自己也写了代码，但是以前没怎么写过计算几何的代码，所以比较吃力！以后多多练习！！

Time Limit: 3000 mSec Memory Limit : 32768 KB

John has a telescope and he always observes the stars. After each observation, John draws all stars on a paper. To simplify the problem, each star is described as a distinct point in two-dimensional space and no three points are in a line.

There are N stars on the paper. John is so boring that he wants to find some ways to kill the time. He chooses three different points random to form a triangle, and then he wants to know the number of points inside this triangle. There is only one point inside the triangle in Figure 1.

The first line of the input contains an integer T (T≤10), indicating the number of cases. Each case begins with a line containing an integer N (3≤N≤1,000), the number of points in the paper. Each of the following N lines contains two integers Xi and Yi 0≤|X_{i}|, |Y_{i}|≤100,000, 1≤i≤N). The next line contains an integer M (0≤M≤1,000,000), the number of queries John will do. Each of the following M lines contains three integers x, y and z (0≤x, y, z<N), the index of the points John has chosen. The stars are labeled from 0 to N-1.

For each test case, print a line containing the test case number (beginning with 1) on its own line, then the answers for each query, one on each line.

2
4
1 1
0 0
0 1
1 0
1
2 1 0
5
0 0
5 0
5 5
0 5
2 1
2
3 1 2
2 0 1

Case 1:
0
Case 2:
0
1

还有可恶的F题目，三人合作写代码也没写完，可能方法不正确，但是开始的时间也有点晚了！老钱甚至为做这个题目做了一个模型，呵呵！

但是按照我们的思路，完全模拟操作的话，除了代码长一点，应该还是可以过得啊！又一大遗憾啊！！

Time Limit: 1000 mSec Memory Limit : 32768 KB

The Megaminx is made in the shape of a dodecahedron, and has 12 face center pieces, 20 corner pieces, and 30 edge pieces. The face centers each have a single color, which identifies the color of that face in the solved state. The edge pieces have two colors, and the corner pieces have three colors. Each face contains a center piece, 5 corner pieces and 5 edge pieces. The corner and edge pieces are shared with adjacent faces. The face centers can only rotate in place, but the other pieces can be permuted by twisting the face layer around the face center. It is showed in Figure 1.

In this problem, the start state of the Megaminx is in Figure 1 where each side of the Megaminx has a single color. According to Figure 2, all sides are numbered as follows: white '0', …, yellow ‘11’. There is a series of operations. What you need to do is to print the end state of the Megaminx after these operations. In each operation, there are two integers s and d. The first integer s indicates which side of the Megaminx should be turned.

The second integer d indicates in which direction the side s should be turned. The value of d is either '1' or '-1' where '1' indicates a clockwise turn and '-1' indicates a counterclockwise turn. The direction is given under the assumption that the viewer is looking directly at the specific side of the Megaminx.

Figure 3 is an example of operation “1 1”. Figure 3(1) indicates the Megaminx before the operation, and Figure 3(2) indicates the Megaminx after the operation.

In the first line there is an integer T (T≤50), indicating the number of cases. Each case begins with a line containing an integer number N (0≤N≤1,000), the number of the operations. Each of the following N lines contains two integers s (0≤s≤11) and d, s indicates which side of the Megaminx should be turned, d indicates which direction the side s should be turned and d can be either '1' or '-1'.

For each test case, print a line containing the test case number (beginning with 1) on its own line, then output twelve lines indicating the twelve sides according to the side numbers as said above. Each line contains eleven integers separated by a blank space indicating the color of each block. Please output the color of each block according to the block number, the block number is showed in Figure 4.

2
0
1
0 1

Case 1:
0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5 5 5
6 6 6 6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9 9
10 10 10 10 10 10 10 10 10 10 10
11 11 11 11 11 11 11 11 11 11 11
Case 2:
0 0 0 0 0 0 0 0 0 0 0
5 5 5 1 1 1 1 1 1 1 1
2 2 1 1 1 2 2 2 2 2 2
3 3 3 3 2 2 2 3 3 3 3
4 4 4 4 4 4 3 3 3 4 4
4 5 5 5 5 5 5 5 4 4 5
6 6 6 6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9 9
10 10 10 10 10 10 10 10 10 10 10
11 11 11 11 11 11 11 11 11 11 11

加油吧，谋事在人，成事在天，如果幸运的话，能进一场FZU的现场赛，如果不行的话，一年之后又是一条好汉！

]]>

]]>

]]>