HDU 1664 – Different Digits [数论+暴力BFS]


Link http://acm.hdu.edu.cn/showproblem.php?pid=1664 Problem Given a positive integer n, your task is to find a positive integer m, which is a multiple of n, and that m contains the least number of different digits when represented in decimal. For ...

HDU 1664 – Different Digits [数论+暴力BFS]

Link http://acm.hdu.edu.cn/showproblem.php?pid=1664 Problem Given a positive integer n, your task is to find a positive integer m, which is a multi...
阅读全文 0

UESTC 491 – Tricks in Bits [二进制+DFS]


Link http://acm.uestc.edu.cn/#/problem/show/491 Mean 给N个整数,可以将其中几个数取反,然后在N个数两两之间插入“与或非”之一,求最终表达式的最小值。 Analysis 两个数“与”之后,1的数目一定小于原来的一半,如果不是,将数取反即可。 由于是64位整数,所以6次“...

UESTC 491 – Tricks in Bits [二进制+DFS]

Link http://acm.uestc.edu.cn/#/problem/show/491 Mean 给N个整数,可以将其中几个数取反,然后在N个数两两之间插入“与或非”之一,求最终表达式的最小值。 A...
阅读全文 0

HDU 1242/ZOJ 1649 – Rescue [最短路]


Link http://acm.hdu.edu.cn/showproblem.php?pid=1242 http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=1649 Problem Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matri...

HDU 1242/ZOJ 1649 – Rescue [最短路]

Link http://acm.hdu.edu.cn/showproblem.php?pid=1242 http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=1649 Problem Angel was caught by the...
阅读全文 0

HDU 3085 – Nightmare Ⅱ [双向BFS]


Link http://acm.hdu.edu.cn/showproblem.php?pid=3085 Problem Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maze. They wi...

HDU 3085 – Nightmare Ⅱ [双向BFS]

Link http://acm.hdu.edu.cn/showproblem.php?pid=3085 Problem Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl fr...
阅读全文 0

HDU 3768 – Shopping [最短路+全排列枚举]


Link 传送门 Problem You have just moved into a new apartment and have a long list of items you need to buy. Unfortunately, to buy this many items requires going to many different stores. You would like to minimize the amount of driving necessary t...

HDU 3768 – Shopping [最短路+全排列枚举]

Link 传送门 Problem You have just moved into a new apartment and have a long list of items you need to buy. Unfortunately, to buy this many items r...
阅读全文 0

HDU 1043 – Eight [最经典的BFS]


Link 传送门 Problem The 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 ...

HDU 1043 – Eight [最经典的BFS]

Link 传送门 Problem The 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is con...
阅读全文 0

HDU 4490 – Mad Veterinarian [无脑BFS]


Link 传送门 Problem Mad Veterinarian puzzles have a mad veterinarian, who has developed several machines that can transform an animal into one or more animals and back again. The puzzle is then to determine if it is possible to change one collecti...

HDU 4490 – Mad Veterinarian [无脑BFS]

Link 传送门 Problem Mad Veterinarian puzzles have a mad veterinarian, who has developed several machines that can transform an animal into one or m...
阅读全文 0

UVa 1312 – Cricket Field [枚举]


Link 点击打开题目链接 Problem Once upon a time there was a greedy King who ordered his chief Architect to build a field for royal cricket inside his park. The King was so greedy, that he would not listen to his Architect’s proposals to build...

UVa 1312 – Cricket Field [枚举]

Link 点击打开题目链接 Problem Once upon a time there was a greedy King who ordered his chief Architect to build a field for royal cricket inside hi...
阅读全文 0

CodeForces 586D – Phillip and Trains [BFS]


点击打开codeforces题目链接 Mean 你正在玩一个手机游戏,游戏是这样的:有三条公路,你刚开始在最左边,每秒钟你可以往右移动一个,然后可以上下移动或者不动,之后这一秒每个火车都往左移动两个格。直到所有火车开走并且始终不发生碰撞你就赢了。问你能否赢。 Anal...

CodeForces 586D – Phillip and Trains [BFS]

点击打开codeforces题目链接 Mean 你正在玩一个手机游戏,游戏是这样的:有三条公路,你刚开始在最左边,每秒钟你可以往右移动一个,然后可以上下移动或者不...
阅读全文 0

CodeForces 485D – Maximum Value [枚举+二分]


点击打开codeforces题目链接 题意 给你一个数组,让你找出两个数字a, b(a < b),使得b%a最大,输出这个最大值 分析 先排序去重,然后对于每一个a,类似于筛法往后找,即找出[a, 2*a), [2*a, 3*a), [3*a, 4*a)…每个区间的最大值,可以用二分找,然后取模找出...

CodeForces 485D – Maximum Value [枚举+二分]

点击打开codeforces题目链接 题意 给你一个数组,让你找出两个数字a, b(a < b),使得b%a最大,输出这个最大值 分析 先排序去重,然后对于每一个a,类似于...
阅读全文 0