会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
智人心
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
42
下一页
2022年7月21日
LeetCode(1544,1560)
摘要: leetcode1544 字符串删除操作: string s = ”12345“; s.erase(m,n); 删除s中从m下标开始的n个字符 leetode1560 int data[n]; //分配栈内存 int*data = new int[n]; //分配堆内存并用栈内存data指向该内存区
阅读全文
posted @ 2022-07-21 16:48 智人心
阅读(25)
评论(0)
推荐(0)
2022年6月23日
20220623jsp运行异常
摘要: System.out cannot be resolved to a type 将jdk版本改到8可以运行
阅读全文
posted @ 2022-06-23 17:07 智人心
阅读(25)
评论(0)
推荐(0)
2022年6月15日
LeetCode(1436) 旅行终点站
摘要: unordered_map的遍历: 参见https://blog.csdn.net/qq_21539375/article/details/122003559 推荐: for(auto kv:map){ cout<<kv.first<<kv.second<<endl; }
阅读全文
posted @ 2022-06-15 22:23 智人心
阅读(21)
评论(0)
推荐(0)
2022年6月7日
java保留2位小数
摘要: System.out.println(String.format("%.2f",money));
阅读全文
posted @ 2022-06-07 18:41 智人心
阅读(29)
评论(0)
推荐(0)
LeetCode(1114)按序打印
摘要: 线程通信 #include <semaphore.h> class Foo { protected: sem_t firstJobDone; sem_t secondJobDone; public: Foo() { sem_init(&firstJobDone, 0, 0); sem_init(&s
阅读全文
posted @ 2022-06-07 10:32 智人心
阅读(39)
评论(0)
推荐(0)
LeetCode(1089)复写零
摘要: vector的插入: vector<int>v; v.insert(v.begin(),val);
阅读全文
posted @ 2022-06-07 10:14 智人心
阅读(23)
评论(0)
推荐(0)
LeetCode(1047)删除字符串中所有相邻重复项
摘要: 用子字符串是过不了的,超时,需要一个一个字符判断 class Solution { public: string removeDuplicates(string s) { int n = s.size(),top = 0; if(n==1)return s; for(int i=0;i<n;i++)
阅读全文
posted @ 2022-06-07 09:20 智人心
阅读(26)
评论(0)
推荐(0)
2022年6月4日
LeetCode(937)重新排列日志文件
摘要: 参考https://blog.csdn.net/qq_33726635/article/details/106649623 C++的substr第二个参数表示长度 java的substr的第二个参数表示end下标
阅读全文
posted @ 2022-06-04 18:41 智人心
阅读(22)
评论(0)
推荐(0)
2022年6月3日
LeetCode703(数据流中的第K大元素)
摘要: 用优先队列存储前k大元素,堆顶是第k大元素,每一次添加一个元素道优先队列,如果队列长度大于k就pop堆顶元素 参考https://blog.csdn.net/qq_41687938/article/details/117827166 class KthLargest { public: priori
阅读全文
posted @ 2022-06-03 20:11 智人心
阅读(28)
评论(0)
推荐(0)
2022年5月22日
LeetCode(197)上升的温度
摘要: 计算两个日期的间隔是否是一天 datediff(w1.recordDate,w2.recordDate)=1 {"headers": ["id"], "values": [[678], [446], [517], [955], [1007], [329], [603], [798], [812],
阅读全文
posted @ 2022-05-22 18:24 智人心
阅读(30)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
42
下一页
公告