摘要:
比赛链接 A 题意 给一个字符串每个物品对应的灯的照明方向,L/R 能照亮它左侧/右侧的所有物品(不包括自己对应的物品),现在能交换相邻两个灯一次(不改变照明方向),问能否找亮所有物品。 题解 知识点:贪心。 显然,如果存在 LR 或 RL 就可以照亮全部,否则全是 L 或 R 就不可行。 时间复杂 阅读全文
摘要:
题目链接 题目 题目描述 Each of Farmer John's N cows (1 ≤ N ≤ 1,000) produces milk at a different positive rate, and FJ would like to order his cows according to 阅读全文
摘要:
题目链接 题目 题目描述 Farmer John is on a boat seeking fabled treasure on one of the N (1 <= N <= 100) islands conveniently labeled 1..N in the Cowribbean Sea. 阅读全文
摘要:
题目链接 题目 题目描述 Farmer John's farm has an outdated network of M pipes (1 <= M <= 500) for pumping milk from the barn to his milk storage tank. He wants t 阅读全文
摘要:
题目链接 题目 题目描述 Bessie has two crisp red apples to deliver to two of her friends in the herd. Of course, she travels the C (1 <= C <= 200,000) cowpaths w 阅读全文
摘要:
题目链接 题目 题目描述 Bessie is running out of money and is searching for jobs. Farmer John knows this and wants the cows to travel around so he has imposed a 阅读全文