Problem Description Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this time. There are many stones on the road…
Stones Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 662 Accepted Submission(s): 391 Problem Description Because of the wrong status of the bicycle, Sempr begin to walk east to west every m…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述: 题目大意 解题方法 数组count 字典Counter 日期 题目地址:https://leetcode.com/problems/jewels-and-stones/description/ 题目描述: You're given strings J representing the types of stones that are jewels, and S rep…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5163 题目意思:有 n 个车站,给出相邻两个车站的距离,即车站 i 和车站 i+1 的距离为 di (1≤ i <n).然后是 m 个人从他的出发点到他想去的终点(都是车站),约定轮到处理第 i 个人的时候,车站的出发点满足:((i-1) mod n) + 1 ,假设车每走一个单位的距离花费一个单位的时间,车开始的时候是从左到右开的.如果车走到最右的车站即车站 n 会调头,此时方向为从右到左开:如果…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5154 题目意思:有 n 门 processes(编号依次为1,2,...,n),然后给出 m 种关系: a,b.表示 process b 要在 process a 之前完成.问经过 m 种关系之后,有没有可能完成所有的 process. 可以利用拓扑排序的思想做.遍历所有 process,处理所有入度为 0 的点,然后把与该点关联的点,即度数都减一.这样处理完之后,每个点的度数应该都是-1,否则就代…