自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1681. Minimum Incompatibility

Source: https://leetcode.com/contest/weekly-contest-218/problems/minimum-incompatibility/You are given an integer array nums​​​ and an integer k. You are asked to distribute this array into k subsets of equal size such that there are no two equal elements

2020-12-07 17:50:52 149

原创 1680. Concatenation of Consecutive Binary Numbers

Source: https://leetcode.com/contest/weekly-contest-218/problems/concatenation-of-consecutive-binary-numbers/Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 10

2020-12-07 16:33:08 241

原创 208. Implement Trie (Prefix Tree)

Source:https://leetcode.com/problems/implement-trie-prefix-tree/Reference: https://leetcode.com/articles/implement-trie-prefix-tree/Description:Implement a trie with insert, search, and startsWith methods.Example:Trie trie = new Trie();trie.insert(“a

2020-08-05 17:20:26 124

原创 258. Add Digits

Source:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.Example:Input: 38Output: 2Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2.Since 2 has only one digit, return it.Follow up:Could you d

2020-07-26 16:10:58 80

原创 260. Single Number III

Source: https://leetcode.com/problems/single-number-iii/Description:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.Example:Inpu

2020-07-23 16:28:06 69

原创 反爬

我浏览了某个网站(暂不透露其名),它是需要用内网或者外网控制系统才能登录,浏览时是动态加载图片,我很想整个都爬下来,但自己爬虫水平实在弱,查了半天也没找到什么好方法。塞翁失马焉知非福,通过这个小失败我反而产生了 网页形成强大的反爬能力 的一点思考。发送请求时可以copy浏览器的user-agent头,这一步ok的,不好反爬。刷新页面后通过network提取有规律的url信息,这一步就比较有意思...

2020-03-29 22:15:25 152

原创 P3367 并查集

Source: https://www.luogu.com.cn/problem/P3367题目描述如题,现在有一个并查集,你需要完成合并和查询操作。输入格式第一行包含两个整数 N,M,表示共有 N 个元素和 M 个操作。接下来 M 行,每行包含三个整数 Z_i,X_i,Y_i当 Z_i=1时,将 X_i与 Y_i所在的集合合并。当 Z_i=2时,输出 X_i与 Y_i是否在同一集合...

2020-02-10 20:10:03 223

原创 1339. Maximum Product of Splitted Binary Tree

Source: https://leetcode.com/problems/maximum-product-of-splitted-binary-tree/Given a binary tree root. Split the binary tree into two subtrees by removing 1 edge such that the product of the sums of...

2020-02-04 13:36:32 464

原创 1338. Reduce Array Size to The Half

Source: https://leetcode.com/problems/reduce-array-size-to-the-half/Given an array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.Return the min...

2020-02-04 12:33:30 358

原创 1337. The K Weakest Rows in a Matrix

Source: https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest r...

2020-02-04 12:06:46 771

原创 C++ STL sort作用于二维vector 效果和应用

随机生成10x10的二维vector,直接调用sort(a.begin(), a.end()),看结果。#include<bits/stdc++.h>using namespace std; int main(){ vector<vector<int> > a(10); for (int i = 0; i < 10;i++) for (i...

2020-02-03 13:37:16 1069

原创 639. Decode Ways II

Source: https://leetcode.com/problems/decode-ways-ii/A message containing letters from A-Z is being encoded to numbers using the following mapping way:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Beyond t...

2020-01-31 21:02:54 94

原创 91. Decode Ways

Source: https://leetcode.com/problems/decode-ways/A message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Given a non-emp...

2020-01-31 20:02:20 82

原创 120. Triangle

Source: https://leetcode.com/problems/triangle/Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the foll...

2020-01-31 19:25:59 84

原创 Image classification notes

source: http://cs231n.github.io/classification/图像表示图片在计算机里是RGB三通道像素值,0是黑,255是白计算机视觉任务的挑战:Viewpoint variation 角度变化Scale variation 尺度变化Deformation 物体变形Occlusion 只能看到物体的一部分,遮挡Illumination conditi...

2020-01-30 20:01:15 127

原创 1335. Minimum Difficulty of a Job Schedule

Source: https://leetcode.com/contest/weekly-contest-173/problems/minimum-difficulty-of-a-job-schedule/You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the i-th job, y...

2020-01-30 19:41:35 542

原创 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance

Source: https://leetcode.com/contest/weekly-contest-173/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/There are n cities numbered from 0 to n-1. Given the array...

2020-01-30 09:51:06 476

原创 168. Excel Sheet Column Title

Source: https://leetcode.com/problems/excel-sheet-column-title/Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...

2020-01-28 10:14:47 78

原创 1333. Filter Restaurants by Vegan-Friendly, Price and Distance

Source: https://leetcode.com/contest/weekly-contest-173/problems/filter-restaurants-by-vegan-friendly-price-and-distance/Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriend...

2020-01-27 10:00:36 247

原创 1332. Remove Palindromic Subsequences

Source: https://leetcode.com/contest/weekly-contest-173/problems/remove-palindromic-subsequences/Given a string s consisting only of letters ‘a’ and ‘b’. In a single step you can remove one palindrom...

2020-01-26 17:40:48 355

原创 1317. Convert Integer to the Sum of Two No-Zero Integers

Source: https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers/Given an integer n. No-Zero integer is a positive integer which doesn’t contain any 0 in its decimal represent...

2020-01-24 19:18:33 189

原创 1323. Maximum 69 Number

Source: https://leetcode.com/problems/maximum-69-number/Given a positive integer num consisting only of digits 6 and 9.Return the maximum number you can get by changing at most one digit (6 becomes ...

2020-01-24 18:04:51 302

原创 1304. Find N Unique Integers Sum up to Zero

Source: https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/Given an integer n, return any array containing n unique integers such that they add up to 0.Example 1:Input: n = 5Outpu...

2020-01-24 16:49:10 256

原创 上台阶

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1190时间限制: 1000 ms 内存限制: 65536 KB提交数: 18910 通过数: 5302【题目描述】楼梯有n(71>n>0)阶台阶,上楼时可以一步上1阶,也可以一步上2阶,也可以一步上3阶,编程计算共有多少种不同的走法。【输入】输入...

2020-01-22 18:25:36 396

原创 吃糖果

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1193时间限制: 1000 ms 内存限制: 65536 KB提交数: 5128 通过数: 4067【题目描述】名名的妈妈从外地出差回来,带了一盒好吃又精美的巧克力给名名(盒内共有 N 块巧克力,0<N<20)。妈妈告诉名名每天可以吃一块或者两块巧克...

2020-01-22 18:18:46 197

原创 流感传染

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1191时间限制: 1000 ms 内存限制: 65536 KB提交数: 7424 通过数: 4017【题目描述】有一批易感人群住在网格状的宿舍区内,宿舍区为n*n的矩阵,每个格点为一个房间,房间里可能住人,也可能空着。在第一天,有些房间里的人得了流感,以后每天,...

2020-01-22 17:44:13 219

原创 判断元素是否存在

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1211时间限制: 1000 ms 内存限制: 65536 KB提交数: 7093 通过数: 2734【题目描述】有一个集合M是这样生成的:(1) 已知k是集合M的元素; (2) 如果y是M的元素,那么,2y+1和3y+1都是M的元素;(3) 除了上述二种情况外,...

2020-01-20 17:34:29 1200

原创 放苹果

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1192时间限制: 1000 ms 内存限制: 65536 KB提交数: 7187 通过数: 4378【题目描述】把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。【输入】第一...

2020-01-18 17:19:33 147

原创 后缀表达式的值

题目来源:http://ybt.ssoier.cn:8088/problem_show.php?pid=1331时间限制: 10 ms 内存限制: 65536 KB提交数: 14268 通过数: 2366【题目描述】从键盘读入一个后缀表达式(字符串),只含有0-9组成的运算数及加(+)、减(—)、乘(*)、除(/)四种运算符。每个运算数之间用一个空格隔开,不需要判断...

2020-01-11 18:06:29 774

原创 主持人的烦恼

链接:https://ac.nowcoder.com/acm/problem/13591来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述一天zzq主持一项游戏,共n位同学,需要两两同学为一组来上台来玩一项游戏。但是,众所周知,玩游戏的时候,如果两个人的颜值差距>=m...

2020-01-10 07:56:10 529

原创 括弧匹配检验

括弧匹配检验时间限制: 1000 ms 内存限制: 65536 KB提交数: 11190 通过数: 3542【题目描述】假设表达式中允许包含两种括号:圆括号和方括号,其嵌套的顺序随意,如([ ]())或[([ ][ ])]等为正确的匹配,[( ])或([ ]( )或 ( ( ) ) )均为错误的匹配。现在的问题是,要求检验一个给定表达式中的括弧是否正确匹配?输入...

2020-01-07 12:02:34 308

原创 脸盆大哥的木桶

链接:https://ac.nowcoder.com/acm/problem/14670来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述彩虹岛网红脸盆大哥最骄傲就是自己制作的木桶。一天????????????拿了????块木板,其中第????块木板的高度为ℎ????,他希望脸盆大哥能够用这些木板制作出精美的木...

2020-01-03 10:34:52 361

原创 A sad story

链接:https://ac.nowcoder.com/acm/problem/15329来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述The Great Wall story of Meng Jiangnv’s Bitter Weeping happened during...

2020-01-03 10:22:34 203

原创 B-苦逼的单身狗

链接:https://ac.nowcoder.com/acm/problem/14547来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述双11又到了,小Z依然只是一只单身狗,对此他是如此的苦恼又无可奈何。为了在这一天脱单小Z决定向女神表白,但性格腼腆的小Z决定隐晦一点,截取一...

2020-01-02 09:02:18 355 1

原创 回文串

链接:https://ac.nowcoder.com/acm/problem/14517来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述既然大家都知道回文串是怎么回事了,那我们就长话短说,现在有一个字符串,长度小于1200,我想知道最长的回文子串长度是多少。输入描述:多组输...

2020-01-02 08:04:52 267 1

原创 回文数

链接:https://ac.nowcoder.com/acm/problem/16811来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述若一个数(首位不为零)从左向右读与从右向左读都一样,我们就将其称之为回文数。例如:给定一个10进制数56,将56加56(即把56从右向左...

2020-01-01 10:20:14 118

原创 打鼹鼠

链接:https://ac.nowcoder.com/acm/problem/20035来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述鼹鼠是一种很喜欢挖洞的动物,但每过一定的时间,它还是喜欢把头探出到地面上来透透气的。根据这个特点阿Q编写了一个打鼹鼠的游戏:在一个nn的网...

2020-01-01 09:44:38 453

原创 手机号码

链接:https://ac.nowcoder.com/acm/problem/21297来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述给你一个整数n表示手机号码的位数再给你m个字符串表示保留的号码,比如911 110 120等问你一共有多少的手机号码不以保留号码开头...

2019-12-31 11:06:55 495

原创 音乐研究

链接:https://ac.nowcoder.com/acm/problem/13222来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述美团外卖的品牌代言人袋鼠先生最近正在进行音乐研究。他有两段音频,每段音频是一个表示音高的序列。现在袋鼠先生想要在第二段音频中找出与第一段音频最...

2019-12-31 08:52:21 331

空空如也

空空如也

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

TA关注的人

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