摘要:
For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to 阅读全文
摘要:
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 8891 阅读全文
摘要:
Jimmy writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes will he write down? Input 阅读全文
摘要:
题目链接: https://odzkskevi.qnssl.com/0c87453efec2747f8e8a573525fd42f9?v=1533651456 题解: 这是一道Trie+BFS的题目; 这是第二次写了 Orz 还是WA好几发; 这一题,我们可以用字典树存已有的单词,在存的时候,记录一 阅读全文
摘要:
Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book 阅读全文
摘要:
ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input每 阅读全文
摘要:
Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the game 阅读全文
摘要:
The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the r 阅读全文
摘要:
现在有n堆石子,第i堆有ai个石子。现在要把这些石子合并成一堆,每次只能合并相邻两个,每次合并的代价是两堆石子的总石子数。求合并所有石子的最小代价。 Input 第一行包含一个整数T(T<=50),表示数据组数。每组数据第一行包含一个整数n(2<=n<=100),表示石子的堆数。第二行包含n个正整数 阅读全文
摘要:
New labyrinth attraction is open in New Lostland amusement park. The labyrinth consists of n rooms connected by m passages. Each passage is colored in 阅读全文
摘要:
Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)…… 这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每 阅读全文
摘要:
The Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the university building 阅读全文
摘要:
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another 阅读全文
摘要:
This is yet another problem dealing with regular bracket sequences. We should remind you that a bracket sequence is called regular, if by inserting «+ 阅读全文
摘要:
There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees 阅读全文
摘要:
'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, ma 阅读全文
摘要:
Farmer John's family pitches in with the chores during milking, doing all the chores as quickly as possible. At FJ's house, some chores cannot be star 阅读全文
摘要:
一:N条直线分割平面 假设,x条线能将平面分为f(x)份,这对于份f(n) 第n条线,和其他n-1条线都有交点时,增加量最大,为n; 则: f(n)=f(n-1)+n; 有f(0)=1;得到:n 条直线分割平面的数量最大为:f(n)=n*(n+1)/2 + 1; 二. “V” 形线分割平面 对于“V 阅读全文
摘要:
Disky and Sooma, two of the biggest mega minds of Bangladesh went to a far country. They ate, coded and wandered around, even in their holidays. They 阅读全文
摘要:
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan Problem Description There are n intersections in Bytetown, connected with m one way str 阅读全文
摘要:
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6325 Interstellar Travel Problem Description After trying hard for many years, Little Q has finally recei 阅读全文
摘要:
Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,...,n , connected by n−1 bidirectional edges. The 阅读全文
摘要:
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322 Problem Description In number theory, Euler's totient function φ(n) counts the positive integers up 阅读全文
摘要:
有一棵由N个结点构成的树,每一条边上都有其对应的权值。现在给定起点,求从该点出发的一条路径(至少有一条边)使得这条路径上的权值之和最大,并输出这个最大值。 Input 第一行一个正整数T,代表数据组数。每组数据第一行两个正整数n(2<=n<=10^5),s(1<=s<=n),分别表示树结点数目以及给 阅读全文
摘要:
链接:http://codeforces.com/contest/401/problem/D 题意:给出一个数字num和m,问通过重新排列num中的各位数字中有多少个数(mod m)=0,直接枚举全排列肯定不行,可以用状压dp来搞.. dp[S][k]表示选了num中的S且(mod m)=k的方案种 阅读全文