
----矩阵乘法
文章平均质量分 83
_Occult_
物語が始まった
展开
-
HDU 2604 Queuing
Problem DescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch原创 2015-05-03 10:19:43 · 495 阅读 · 0 评论 -
ZOJ 2974 Just Pour the Water
Shirly is a very clever girl. Now she has two containers (A and B), each with some water. Every minute, she pours half of the water in A into B, and simultaneous pours half of the water in B into A. A原创 2017-02-17 21:31:38 · 337 阅读 · 0 评论 -
FZU 1627 Revival's road
DescriptionOaiei is idle, and recently he wants to travel around the country. In his country there are N cities, they are numbered from 1 to N. There are roads between some cities, but some are原创 2016-08-17 20:31:40 · 310 阅读 · 0 评论 -
HDU 5868 Different Circle Permutation
DescriptionYou may not know this but it's a fact that Xinghai Square is Asia's largest city square. It is located in Dalian and, of course, a landmark of the city. It's an ideal place for outing a原创 2016-09-29 17:46:47 · 724 阅读 · 0 评论 -
ZOJ 3707 Calculate Prime S
DescriptionDefine S[n] as the number of subsets of {1, 2, ..., n} that contain no consecutive integers. For each S[n], if for all i (1 ≤ i n) gcd(S[i],S[n]) is 1, we call that S[n] as a Prime S.原创 2016-04-12 23:31:42 · 645 阅读 · 0 评论 -
POJ 3420 Quad Tiling
DescriptionTired of the Tri Tiling game finally, Michael turns to a more challengeable game, Quad Tiling:In how many ways can you tile a 4 × N (1 ≤ N ≤ 109) rectangle with 2 × 1 dominoes? For原创 2016-08-03 17:27:23 · 399 阅读 · 0 评论 -
HDU 5690 All X
Problem DescriptionF(x,m) 代表一个全是由数字x组成的m位数字。请计算,以下式子是否成立:F(x,m) mod k ≡ c Input第一行一个整数T,表示T组数据。每组测试数据占一行,包含四个数字x,m,k,c1≤x≤9 1≤m≤10100≤ck≤10,000 Output原创 2016-05-21 19:05:55 · 719 阅读 · 0 评论 -
HDU 5674 Function
Problem DescriptionThere is a function f(n)=(a+b√)n+(a−b√)n. a and b are integers (1≤a,b≤1,000,000).Maybe the function looks complex but it is actually an integer.The question is to calculate原创 2016-04-22 23:21:14 · 709 阅读 · 0 评论 -
HDU 5667 Sequence
Problem Description Holion August will eat every thing he has found. Now there are many foods,but he does not want to eat all of them at once,so he find a sequence.fn=⎧⎩⎨⎪⎪1,ab,a原创 2016-04-16 21:49:42 · 644 阅读 · 0 评论 -
HDU 5451 Best Solver
Problem DescriptionThe so-called best problem solver can easily solve this problem, with his/her childhood sweetheart.It is known that y=(5+26√)1+2x.For a given integer x (0≤x232) and a gi原创 2015-09-19 21:29:42 · 906 阅读 · 0 评论 -
HDU 5434 Peace small elephant
Problem DescriptionXiao Ming likes playing the international chess ,especially like the elephant(it can move by slant while no barrier),but he think the big elephant of the chess is cruel,and原创 2015-09-16 13:32:05 · 643 阅读 · 0 评论 -
HDU 5411 CRB and Puzzle
Problem DescriptionCRB is now playing Jigsaw Puzzle.There are N kinds of pieces with infinite supply.He can assemble one piece to the right side of the previously assembled one.For each ki原创 2015-08-20 17:16:38 · 699 阅读 · 0 评论 -
HDU 4686 Arc of Dream
Problem DescriptionAn Arc of Dream is a curve defined by following function:wherea0 = A0ai = ai-1*AX+AYb0 = B0bi = bi-1*BX+BYWhat is the value of AoD(N) modulo 1,000,000,007?In原创 2015-07-18 22:20:40 · 409 阅读 · 0 评论 -
HDU 2157 How many ways??
Problem Description春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问鼎广场看看喷泉, 再去教室, 也可以先到体育场跑几圈,原创 2015-07-18 22:13:40 · 452 阅读 · 0 评论 -
HDU 1575 Tr A
Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 Output对应每组数据,输出Tr(A^k)%9973。Sample Input22 21 00 13 9999999原创 2015-07-18 22:12:23 · 533 阅读 · 0 评论 -
HDU 4565 So Easy!
Problem Description A sequence Sn is defined as:Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculate Sn. You, a top coder, say: So easy原创 2015-07-18 22:16:22 · 402 阅读 · 0 评论 -
ZOJ 2316 Matrix Multiplication
DescriptionLet us consider undirected graph G = which has N vertices and M edges. Incidence matrix of this graph is N * M matrix A = {a ij}, such that a ij is 1 if i-th vertex is one of the ends o原创 2015-03-25 23:23:42 · 435 阅读 · 0 评论 -
ZOJ 3497 Mistwald
In chapter 4 of the game Trails in the Sky SC, Estelle Bright and her friends are crossing Mistwald to meet their final enemy, Lucciola.Mistwald is a mysterious place. It consists of M * N scenes, n原创 2017-02-19 17:18:37 · 295 阅读 · 0 评论