Dream On

今天很残酷,明天更残酷,后天很美好,但绝对大部分是死在明天晚上,所以每个人不要放弃今天。
随笔 - 5, 文章 - 3, 评论 - 2, 引用 - 0
数据加载中……

2010年12月26日

2011就要来啦

2011就要来啦,加油AC啊!
目前状况总结:
搜索(BFS+DFS),图论(最小生成树,单源最短路径),计算几何(凸包)需要深入学习的东西太多了,没时间上这个Blog,尽量更新吧!!!!!记录一下!!

posted @ 2010-12-26 20:55 FireDuck 阅读(133) | 评论 (0)编辑 收藏

2010年10月25日

定了火车票

今天上午买了到成都的火车票,从宝鸡中转,11-03下午出发,虽是淡季,一票难求啊,蜀道难,难于上青天啊。近日不断学习计算几何,争取搞出一道来!

posted @ 2010-10-25 09:58 FireDuck 阅读(137) | 评论 (0)编辑 收藏

2010年10月10日

10年最后一场网络

10年最后一场网络
FZU的11题网络赛1个小时前落下帷幕,辉哥还是那么生猛,一人连A三题……Orz中!!
今天的C题目留下一大遗憾,貌似可以暴力过,自己也写了代码,但是以前没怎么写过计算几何的代码,所以比较吃力!以后多多练习!!
Problem C How many stars

Accept: 33    Submit: 911
Time Limit: 3000 mSec    Memory Limit : 32768 KB

 Problem Description

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.

Figrue 1

 Input

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≤|Xi|, |Yi|≤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.

 Output

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.

 Sample Input

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

 Sample Output

Case 1: 0 Case 2: 0 1
还有可恶的F题目,三人合作写代码也没写完,可能方法不正确,但是开始的时间也有点晚了!老钱甚至为做这个题目做了一个模型,呵呵!
但是按照我们的思路,完全模拟操作的话,除了代码长一点,应该还是可以过得啊!又一大遗憾啊!!
Problem F Megaminx

Accept: 131    Submit: 559
Time Limit: 1000 mSec    Memory Limit : 32768 KB

 Problem Description

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.

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.

Figure 2

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.

Figure 3

 Input

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'.

 Output

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.

Figure 4

 Sample Input

2 0 1 0 1

 Sample Output

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的现场赛,如果不行的话,一年之后又是一条好汉!

posted @ 2010-10-10 18:04 FireDuck 阅读(396) | 评论 (2)编辑 收藏

2010年10月8日

今天添加了流量统计模块

今天添加了流量统计模块,很实用!

posted @ 2010-10-08 08:03 FireDuck 阅读(213) | 评论 (0)编辑 收藏

2010年10月6日

第一篇随笔!

近日看了不少出名大牛的Blog,感觉离高手的差距真大啊!越发的感觉自己知道的太少了!好多知识需要学习!继续努力吧!

posted @ 2010-10-06 22:52 FireDuck 阅读(210) | 评论 (0)编辑 收藏