题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4031 Problem Description Today is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to attack American again. However, American is protected by a high wall this time, which can be treating…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4069 Problem Description Today we play a squiggly sudoku, The objective is to fill a 9*9 grid with digits so that each column, each row, and each of the nine Connecting-sub-grids that compose the grid co…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4064 Problem Description Carcassonne is a tile-based board game for two to five players.Square tiles are printed by city segments,road segments and field segments. The rule of the game is to put the tile…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4063 Description You are playing a flying game. In the game, player controls an aircraft in a 2D-space. The mission is to drive the craft from starting point to terminal point. The craft needs wireless s…
Weak Pair Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 439    Accepted Submission(s): 155 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a…
HDU 4291 A Short problem(2012 ACM/ICPC Asia Regional Chengdu Online) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=4291 Description 给一个式子求结果.类似Fibonacci的公式g(n)=3*g(n-1)+g[n-2]. Input 给你n(1<=n<=1e18) Output 求g(g(g(n))) Sample Input 样例第一个就是0什么鬼,虽然没影响.…
Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 802    Accepted Submission(s): 309 Problem Description A mysterious country will hold a football world championships---Abnormal Cup…
Attack Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 2523    Accepted Submission(s): 805 Problem Description Today is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to attac…
成功袭击次数=所有袭击次数-成功防守次数 需要一个辅助pre来记录上一次袭击成功什么时候,对于每个查询,从上一次袭击成功开始,每隔t更新一次. 感觉这样做最坏时间复杂度是O(n^2),这里 说是O(q)*O(q/t)log(n),应该是超时边缘. 能AC或许因为数据不强. PS.初始化的时候直接memset会超时,每次根据N的大小build线段树,memset也根据N的大小来就能AC. #include <cstdio> #include <cstring> #include &l…
Problem Description Pfctgeorge is totally a tall rich and handsome guy. He plans to build a huge water transmission network that covers the whole southwest China. To save the fund, there will be exactly one path between two cities. Since the water ev…