Skip to content

Home

HDU 4965 Fast Matrix Calculation

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 206    Accepted Submission(s): 116

Problem Description
One day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a crazy problem for her. Bob has a six-faced dice which has numbers 0, 1, 2, 3, 4 and 5 on each face. At first, he will choose a number N (4 <= N <= 1000), and for N times, he keeps throwing his dice for K times (2 <=K <= 6) and writes down its number on the top face to make an N*K matrix A, in which each element is not less than 0 and not greater than 5\. Then he does similar thing again with a bit difference: he keeps throwing his dice for N times and each time repeat it for K times to write down a K*N matrix B, in which each element is not less than 0 and not greater than 5\. With the two matrix A and B formed, Alice’s task is to perform the following 4-step calculation.

HDU 4952 Number Transformation

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 612    Accepted Submission(s): 310

Problem Description
Teacher Mai has an integer x. He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i. He wants to know what is the number x now.

HDU 4945 2048

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 590    Accepted Submission(s): 136

Problem Description
Teacher Mai is addicted to game 2048\. But finally he finds it's too hard to get 2048\. So he wants to change the rule: You are given some numbers. Every time you can choose two numbers of the same value from them and merge these two numbers into their sum. And these two numbers disappear meanwhile. If we can get 2048 from a set of numbers with this operation, Teacher Mai think this multiset is good. You have n numbers, A1,...,An. Teacher Mai ask you how many subsequences of A are good. The number can be very large, just output the number modulo 998244353.

我的HerbstluftWM

一直以来想折腾一下WM,但是又感觉麻烦。前天把笔记本带到机房就借此机会在虚拟机中玩了一下。发现事实上比我想像的要简单的多。少量配置了一下两个配置文件就能用了。然后使用compton做透明特效。看起来也挺简洁美观的。

WM最大的特点就是轻便,herbstluftWM也不例外。安装只有几百兆,附加依赖少,几乎一个命令的事情。启动、响应速度都是普通DE无法比拟的快。加上compton的透明效果,稍加修饰整个系统的界面就非常美观了。

两个配置文件与更详细的说明我已经push到了github:click here

Connections between cities

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4759    Accepted Submission(s): 1341

Problem Description
After World War X, a lot of cities have been seriously damaged, and we need to rebuild those cities. However, some materials needed can only be produced in certain places. So we need to transport these materials from city to city. For most of roads had been totally destroyed during the war, there might be no path between two cities, no circle exists as well. Now, your task comes. After giving you the condition of the roads, we want to know if there exists a path between any two cities. If the answer is yes, output the shortest path between them.

内网 2085马农

Description

在观看完战马检阅之后,来自大草原的两兄弟决心成为超级“马农”,专门饲养战马。

兄弟两回到草原,将可以养马的区域,分为N*N的单位面积的正方形,并实地进行考察,归纳出了每个单位面积可以养马所获得的收益。接下来就要开始规划他们各自的马场了。

首先,两人的马场都必须是矩形区域。同时,为了方便两人互相照应,也为了防止马匹互相走散,规定两个马场的矩形区域相邻,且只有一个交点。最后,互不认输的两人希望两个马场的收益相当,这样才不会影响他们兄弟的感情。

现在,兄弟两找到你这位设计师,希望你给他们设计马场,问共有多少种设计方案。

内网2082 字母

Description

乐乐开始学习英文字母了,小C为他准备了很多字母牌,每张牌有一个英文字母。有天乐乐把所有的牌排成一行,这些字母竟然形成了一个回文串。小C想知道,乐乐在排字母的时候,有多少种情况,最后的字母形成回文串。

Input

输入一行,表示乐乐有哪些字母,均大写。

Output

输出有多少种情况,排列的字母是一个回文串。

HDU4944 FSF’s game

Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 166    Accepted Submission(s): 76

Problem Description
FSF has programmed a game. In this game, players need to divide a rectangle into several same squares. The length and width of rectangles are integer, and of course the side length of squares are integer. After division, players can get some coins. If players successfully divide a AxB rectangle(length: A, width: B) into KxK squares(side length: K), they can get A*B/ gcd(A/K,B/K) gold coins. In a level, you can’t get coins twice with same method. (For example, You can get 6 coins from 2x2(A=2,B=2) rectangle. When K=1, A*B/gcd(A/K,B/K)=2; When K=2, A*B/gcd(A/K,B/K)=4; 2+4=6; )

内网2073 城主GeassCode

Description

GeassCode凭借自己在topcoder上的超凡表现,赢得了国王的喜爱,国王赏赐他一座城池。这座城池里有n个 村子,m条路连接这些村子。坐上城主的GeassCode决定要修路,他打算用最少的代价把所以的村子连在一起。据探子回报,有些村子之间虽然原来没有路 径,但是可以强行的去建一条路。GeassCode想知道,如果强行在某两个村子之间建一条路,最后的总花费是多少?

POJ1989 Distance Queries

Description

Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The input to this problem consists of the same input as in "Navigation Nightmare",followed by a line containing a single integer K, followed by K "distance queries". Each distance query is a line of input containing two integers, giving the numbers of two farms between which FJ is interested in computing distance (measured in the length of the roads along the path between the two farms). Please answer FJ's distance queries as quickly as possible!