自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 力扣200:岛屿数量

通过这道题学到了很多,下面是官方给出的三种解法,分别是深度优先遍历、广度优先遍历和并查集。 方法一:深度优先遍历 class Solution { private: void dfs(vector<vector<char>>& grid, int r, int c) { int nr = grid.size(); int nc = grid[0].size(); grid[r][c] = '0'; if

2021-10-21 15:41:02 94

原创 IEEE极限编程:Word Permutation

#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef struct { string word; int index; }WordPermutation; bool cmp(WordPermutation a, WordPermutation b) { for (int i = 0; i < a.word.length()&&a..

2021-10-20 19:10:07 164

原创 力扣33:搜索旋转排序数组

力扣33:搜索旋转排序数组 复杂化二分法: class Solution { public: int search(vector<int>& nums, int target) { int n = (int)nums.size(); if (!n) { return -1; } if (n == 1) { return nums[0] == target ? 0 : -

2021-10-20 19:04:34 76

原创 IEEE极限编程练习:Sorting Partition

题目描述: 自己上来第一反应还是暴力法,思路不够开阔找不到其他好的方法,下面是一位大神的做法: #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long sum = 0, etalon_sum = 0; int ans = 0; vector <int> e; vector <long long&gt

2021-10-17 10:41:31 422

原创 IEEE极限编程:Word Ordering

马上要参加IEEE编程比赛了,找两道简单的题目练习一下。

2021-10-16 15:05:42 762

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除