03 2018 档案

摘要:Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Su 阅读全文
posted @ 2018-03-17 14:23 王者峡谷的码农 阅读(144002) 评论(0) 推荐(0)
摘要:两个相等长度字符串都由数字组成,每次只能进行交换操作或加一操作或减一操作,求出使两个字符串相等的最少操作数。 思路: 1.两两判断交换之后操作少,还是不交换操作少。(不交换操作数为:对应数字差值的绝对值之和,交换的操作数为:交换之后对应数字差值的绝对值之和+1) 2.如果交换可以减少操作数,把交换后 阅读全文
posted @ 2018-03-17 11:11 王者峡谷的码农 阅读(12998) 评论(0) 推荐(0)
摘要:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Inp 阅读全文
posted @ 2018-03-14 10:01 王者峡谷的码农 阅读(144632) 评论(0) 推荐(0)
摘要:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords 阅读全文
posted @ 2018-03-14 09:41 王者峡谷的码农 阅读(7639) 评论(0) 推荐(0)
摘要:一直想用java实现栈、队列,可是没时间,马上要找实习了,就复习了一下算法,实现了一个简单的栈,代码还是有问题的,有兴趣的兄弟帮忙改正 问题:多线程的话pop和push只能有一个方法被执行需要加互斥变量 阅读全文
posted @ 2018-03-02 21:48 王者峡谷的码农 阅读(7576) 评论(0) 推荐(0)
摘要:1 package strategy; 2 /* 3 * 具体策略角色:高级会员 4 */ 5 public class AdvancedMemberStrategy implements MemberStrategy{ 6 7 @Override 8 public double discount( 阅读全文
posted @ 2018-03-01 15:29 王者峡谷的码农 阅读(144486) 评论(1) 推荐(0)