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

CodeForces 589K – Task processing [暴力/数学/优先队列]


Link http://codeforces.com/problemset/problem/589/K Problem Vasya wants to create a computing system to process arbitrary tasks. As a part of the system he needs an algorithm which will choose an order of task execution. He came up with the follow...

CodeForces 589K – Task processing [暴力/数学/优先队列]

Link http://codeforces.com/problemset/problem/589/K Problem Vasya wants to create a computing system to process arbitrary tasks. As a part of the s...
阅读全文 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

CodeForces 651D – Watchmen [二分]


Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, y...

CodeForces 651D – Watchmen [二分]

Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and righ...
阅读全文 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