2018年2月10日

java 对一个字符串去重,即去掉字符串内重复元素

摘要: String str ="abc|efa|abc|efa|abc"; String str1 = str.replaceAll("(?s)(.)(?=.*\\1)", ""); System.out.println(str1); 其中:("(?s)(.)(?=.*\\1)解释如下; (?s) 开启单 阅读全文

posted @ 2018-02-10 21:40 Esquecer 阅读(1158) 评论(0) 推荐(0) 编辑

TOJ 4383 n % ( pow( p , 2) ) ===0

摘要: 传送门:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=4383 描述 There is a number n , determine whether there is a p (p>1) that p^2 i 阅读全文

posted @ 2018-02-10 15:18 Esquecer 阅读(252) 评论(0) 推荐(0) 编辑

TOJ 3589 likaer的最长点距

摘要: 传送门:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=3589 时间限制(普通/Jav a):7000MS/70000MS 内存限制:65536KByte 描述 我们都知道,炉子喜欢做题,尤其喜欢做likae 阅读全文

posted @ 2018-02-10 15:01 Esquecer 阅读(138) 评论(0) 推荐(0) 编辑

牛客网练习赛12---A and B

摘要: A题传送门:https://www.nowcoder.net/acm/contest/68/A B题传送门: https://www.nowcoder.net/acm/contest/68/B A题: 题目描述 我们定义一个圆 C 为以原点 (0, 0) 为中心的单位圆(半径为 1 的圆)。给定在 阅读全文

posted @ 2018-02-10 14:51 Esquecer 阅读(212) 评论(0) 推荐(0) 编辑

TOJ 2755 国际象棋(搜索)

摘要: 传送门:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=2755 思路:对起点到终点进行广搜,由于n特别大,不能用二维数组记录走过的点,可以用STL的map进行记录,map<pair<int,int>,int> 阅读全文

posted @ 2018-02-10 14:38 Esquecer 阅读(147) 评论(0) 推荐(0) 编辑

导航