上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 57 下一页

2017年11月28日

17965 幸运之星(优先做) 约瑟夫环问题O(n)

摘要: 17965 幸运之星(优先做) 时间限制:100MS 内存限制:65535K 提交次数:0 通过次数:0 题型: 编程题 语言: G++;GCC;VC Description 每年新年派对的最后一个节目就是选出下年的“幸运之星”,有丰厚的大礼包的噢~~。 O(∩_∩)O 所以每位参加派对的人士都摩拳 阅读全文

posted @ 2017-11-28 15:55 stupid_one 阅读(1292) 评论(0) 推荐(0) 编辑

2017年11月26日

leetcode 620. Not Boring Movies 用where语句判断

摘要: https://leetcode.com/problems/not-boring-movies/description/ 不管题目简不简单,现在先熟悉语法。 直接用where语句判断即可,判断奇偶可以用 % 还有用 & 也行 阅读全文

posted @ 2017-11-26 13:45 stupid_one 阅读(153) 评论(0) 推荐(0) 编辑

leetcode 627. Swap Salary 数据库带判断的更新操作

摘要: https://leetcode.com/problems/swap-salary/description/ 用 set keyWord = Case depentedWord when haha then baba else lala end 最后需要end # Write your MySQL 阅读全文

posted @ 2017-11-26 00:28 stupid_one 阅读(276) 评论(0) 推荐(0) 编辑

2017年11月24日

leetcode 182. Duplicate Emails having的用法 SQL执行顺序

摘要: https://leetcode.com/problems/duplicate-emails/description/ 首先sql的执行顺序是 from-->where-->group by >having-->select-->order by 所以用了group后,用where判断是错误的 ht 阅读全文

posted @ 2017-11-24 14:29 stupid_one 阅读(128) 评论(0) 推荐(0) 编辑

leetcode 181 Employees Earning More Than Their Managers 不会分析的数据库复杂度

摘要: https://leetcode.com/problems/employees-earning-more-than-their-managers/description/ 老师上课没分析这些的复杂度,我大概认为子查询要O(n^2) 一开始,直接用了子查询,2400ms.... # Write you 阅读全文

posted @ 2017-11-24 13:34 stupid_one 阅读(150) 评论(0) 推荐(0) 编辑

17082 两个有序数序列中找第k小(优先做) O(logn)

摘要: 17082 两个有序数序列中找第k小(优先做) 时间限制:1000MS 内存限制:65535K提交次数:0 通过次数:0 题型: 编程题 语言: G++;GCC;VC Description 输入格式 第一行有三个数,分别是长度m、长度n和k,中间空格相连(1<=m,n<=100000; 1<=k< 阅读全文

posted @ 2017-11-24 12:38 stupid_one 阅读(675) 评论(0) 推荐(0) 编辑

2017年11月21日

leetcode 176. Second Highest Salary

摘要: https://leetcode.com/problems/second-highest-salary/description/ 题目要求输出第二大的成绩。 首先可以想到去重,然后排序,相当于输出第二个成绩。 这个用limit a offset b表示,从第b项开始,选出a个,下标从0开始 然后,如 阅读全文

posted @ 2017-11-21 20:33 stupid_one 阅读(376) 评论(0) 推荐(0) 编辑

leetcode 175 Combine Two Tables join用法

摘要: https://leetcode.com/problemset/database/ ACM退役,刚好要学sql,一定要刷题才行,leetcode吧。 这一题,说了两个表,一个左一个右吧,左边的personId是唯一的,但是右边的PersonId是不唯一的,所以不去重。 然后,总结下各种join的用法 阅读全文

posted @ 2017-11-21 18:43 stupid_one 阅读(178) 评论(0) 推荐(0) 编辑

2017年11月15日

suffix ACM-ICPC 2017 Asia Qingdao

摘要: Consider n given non-empty strings denoted by s1 , s2 , · · · , sn . Now for each of them, you need to select a corresponding suffix, denoted by suf1, 阅读全文

posted @ 2017-11-15 14:36 stupid_one 阅读(844) 评论(0) 推荐(0) 编辑

2017年11月12日

多层BFS

摘要: https://vjudge.net/problem/HDU-6223 http://blog.csdn.net/qq_40482495/article/details/78492841 阅读全文

posted @ 2017-11-12 11:15 stupid_one 阅读(129) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 57 下一页

导航