上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页
摘要: //原题链接https://leetcode.com/problems/ipo/ 题目描述 Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital 阅读全文
posted @ 2019-02-26 23:17 Moliay 阅读(9) 评论(0) 推荐(0) 编辑
摘要: //原题链接https://leetcode.com/problems/my-calendar-iii/submissions/ 题目描述 Implement a MyCalendarThree class to store your events. A new event can always b 阅读全文
posted @ 2019-02-25 09:26 Moliay 阅读(11) 评论(0) 推荐(0) 编辑
摘要: package javaPractice; //2是第一个素数,3是第二个素数,则第100001个素数是多少 //思路:把每个素数的倍数扔掉 public class Contest21 { public static void main(String[] args) { int n = 10000 阅读全文
posted @ 2019-02-24 10:39 Moliay 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 设 A rem B || A mod B 生成机制 取余:采取fix()函数,向0方向取整 取模:采取floor()函数,向无穷小方向取整当A,B异号时(其实同号也是这个规律…) 取余:结果和A同号 取模:结果和B同号 eg: 1.①5 mod 2 = 1 ②5 rem 2 = 1 ③-5 mod 阅读全文
posted @ 2019-02-23 21:19 Moliay 阅读(43) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args){ System.out.println("yes"); } } 谁说程序员不幽默~ 阅读全文
posted @ 2019-02-23 16:07 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: package javaPractice; /* * 啤酒每罐2.3元,饮料每罐1.9元。小明买了若干啤酒和饮料,一共花了82.3元。 我们还知道他买的啤酒比饮料的数量少,请你计算他买了几罐啤酒。 注意:答案是一个整数。请通过浏览器提交答案。 不要书写任何多余的内容(例如:写了饮料的数量,添加说明文 阅读全文
posted @ 2019-02-23 12:20 Moliay 阅读(4) 评论(0) 推荐(0) 编辑
摘要: package javaPractice; /* * (递归基础题) * 某财务部门结账时发现总金额不对头。很可能是从明细上漏掉了某1笔或几笔。 * 如果已知明细账目清单,能通过编程找到漏掉的是哪1笔或几笔吗? * 如果有多种可能,则输出所有可能的情况。 * 我们规定:用户输入的第一行是:有错的总金 阅读全文
posted @ 2019-02-23 11:28 Moliay 阅读(14) 评论(0) 推荐(0) 编辑
摘要: package javaPractice; import java.util.Scanner; public class Contest13 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); 阅读全文
posted @ 2019-02-22 18:15 Moliay 阅读(7) 评论(0) 推荐(0) 编辑
摘要: //原题链接https://leetcode.com/problems/number-of-digit-one/ 题目描述 Given an integer n, count the total number of digit 1 appearing in all non-negative inte 阅读全文
posted @ 2019-02-22 15:29 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: *理论上,递归与循环是等价的,即任何循环都可以重写为递归形式 eg: package javaPractice; public class Contest { public static void main(String []args) { print(5); System.out.println( 阅读全文
posted @ 2019-02-21 17:34 Moliay 阅读(9) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页