上一页 1 2 3 4 5 6 7 8 ··· 42 下一页
摘要: 目前只能暴破,应该有更高效的算法 阅读全文
posted @ 2022-05-13 20:22 智人心 阅读(12) 评论(0) 推荐(0)
摘要: char转string的时候注意char数组的最后一个字符要是'\0' 阅读全文
posted @ 2022-05-13 20:10 智人心 阅读(31) 评论(0) 推荐(0)
摘要: set的添加: set<string>s; s.insert("abc"); 阅读全文
posted @ 2022-05-13 19:52 智人心 阅读(32) 评论(0) 推荐(0)
摘要: 注意仅有一个字符不相等是false 阅读全文
posted @ 2022-05-13 14:55 智人心 阅读(22) 评论(0) 推荐(0)
摘要: 注意 1: left join 用的是on而不是where 2: 如果空则赋0 ifnull(sum(r.distance,0) select u.name name,ifnull(sum(r.distance),0) travelled_distance from Users u left joi 阅读全文
posted @ 2022-05-13 13:44 智人心 阅读(35) 评论(0) 推荐(0)
摘要: 利用unordered_map<int,int>hashmap可以将查找的时间缩小至O(1) class Solution { public: vector<int> arrayRankTransform(vector<int>& arr) { int n = arr.size(),MIN,MINP 阅读全文
posted @ 2022-05-13 09:04 智人心 阅读(17) 评论(0) 推荐(0)
摘要: 没办法,背下来吧 import java.text.*; import java.util.*; import java.lang.*; class Solution { public int daysBetweenDates(String date1, String date2){ int day 阅读全文
posted @ 2022-05-12 21:44 智人心 阅读(21) 评论(0) 推荐(0)
摘要: char数组转string 方法1: string str(ch); 方法2: string str = ch; 方法3(对string进一步操作): string s0 = ch; string s3 (s0, 8, 3); 阅读全文
posted @ 2022-05-12 21:13 智人心 阅读(25) 评论(0) 推荐(0)
摘要: 判断两个矩形的边所在直线关系即可 class Solution { public: bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) { return !(rec1[0]>=rec2[2]||rec1[2]<=rec2[0]| 阅读全文
posted @ 2022-05-12 19:25 智人心 阅读(20) 评论(0) 推荐(0)
摘要: map<string,int>的用法 map<string,int>mp; mp["abc"]++; 阅读全文
posted @ 2022-05-12 14:05 智人心 阅读(24) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 42 下一页