且歌且行,眉目轻盈。何妨吟啸且徐行。|

胖柚の工作室

园龄:2年1个月粉丝:2关注:15

随笔分类 -  AcWing

P52 数组中出现次数超过一半的数字
摘要:题目链接: 方法一: 若数组中有数字的出现次数超过数组长度的一半(绝对众数),则将该数组排序后中间位置的数一定就是该数。 class Solution { public: int moreThanHalfNum_Solution(vector<int>& nums) { sort(nums.begi
4
0
0
AcWing 768. 忽略大小写比较字符串大小
摘要:题目链接: #include <iostream> using namespace std; string get(string s) { string res; for (auto c : s) res += tolower(c); return res; } int main() { strin
9
0
0
AcWing 3559. 围圈报数
摘要:考点:约瑟夫环问题,环形链表,队列 #include <bits/stdc++.h> using namespace std; const int N = 55; int ne[N];//链表指针数组 int main() { ios::sync_with_stdio(false), cin.tie
10
0
0
点击右上角即可分享
微信分享提示
深色
回顶
收起