###题目 Jump Game ###解题方法 这道题可以用贪心算法的思想解决,类似于Jump Game II。 ###代码 class Solution: def canJump(self, nums: List[int]) -> bool: curEnd = 0 curFarthest = 0 ...
分类:
其他好文 时间:
2020-11-12 13:58:21
阅读次数:
5
概述 Lambda 表达式(lambda expression) 是一个匿名函数,它是matlab中定义的一种函数形式,他的生成方式最简捷。 lambda 抽象(lambda abstraction) 是一个匿名函数,即没有函数名的函数。 使用方法 条件:接口中只有一个方法 like = ()-> ...
分类:
其他好文 时间:
2020-11-11 16:45:16
阅读次数:
11
八皇后 - queen 模板 题目链接 Code 1_queen.rar:https://www.90pan.com/b2125383 密码:bvsw queen 文件名 queen.cpp 分数 1 初始化代码 #include <iostream> #include <cstring> usin ...
分类:
其他好文 时间:
2020-11-11 16:34:56
阅读次数:
11
https://darkbzoj.tk/problem/4316 求一个仙人掌的最大独立集 先把他建出圆方树来,每个环选一个点当做“这个环的根”,作为对应方点的父亲,其他换上的点作为这个方点的儿子 考虑用 \(f(u,1/2)\) 来表示 \(u\) 的子树中,\(u\) 这个点选/不选的最大独立集 ...
分类:
其他好文 时间:
2020-11-11 16:24:36
阅读次数:
8
###P2915 [USACO08NOV]Mixed Up Cows G dfs去做 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #define ll long long using namespace ...
分类:
其他好文 时间:
2020-11-11 15:59:42
阅读次数:
7
B - Yet Another Crosses Problem D - Glider 1.题意 飞机在h米的高空水平飞行,飞行员可以在任意整数点跳伞,跳伞过程中,每秒飞行员都会向前移动一米,向下移动一米。有n个不相交的区间,飞行员在这些区间上空飞行时不会下降,给出每个区间的左右端点,求飞行员从跳伞到 ...
分类:
其他好文 时间:
2020-11-11 15:46:49
阅读次数:
4
题目 1054: [二级C语言]计算素数和 #include <stdio.h> #include <math.h> int isprime(int x)//判断素数,返回1表示x为素数 { if(x==1)return 1; int i,emp=sqrt(x); for(i=2;i<=emp;++ ...
分类:
其他好文 时间:
2020-11-10 11:16:27
阅读次数:
6
没事的时候刷题leetcode的时候遇到dense_rank的使用。 create table Scores ( Id int, Score decimal(5,2) ) go select Score,row_number() over (order by Score desc) as Rank ...
分类:
其他好文 时间:
2020-11-08 17:20:44
阅读次数:
20
调用本地css文件的方法 setting.py里面的内容 import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirn ...
分类:
其他好文 时间:
2020-11-08 16:56:15
阅读次数:
21
Difficulty: Medium Related Topics: Hash Table, String Link: https://leetcode.com/problems/group-anagrams/ Description Given an array of strings strs, ...
分类:
其他好文 时间:
2020-11-08 16:43:41
阅读次数:
19