缘由:看到redis的缓存淘汰机制,便自己实现了一下 代码实现(双向链表+HashMap) package com.jarjune.jdalao.framework.algorithm; import java.util.*; /** * LRU * @author jarjune * @versi ...
分类:
编程语言 时间:
2020-11-24 12:37:52
阅读次数:
8
HDU2040 亲和数 题目链接 Problem Description 古希腊数学家毕达哥拉斯在自然数研究中发现,220的所有真约数(即不是自身的约数)之和为: 1+2+4+5+10+11+20+22+44+55+110=284。 而284的所有真约数为1、2、4、71、 142,加起来恰好为22 ...
分类:
其他好文 时间:
2020-11-24 12:32:09
阅读次数:
8
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace odds { class Program { s ...
分类:
编程语言 时间:
2020-11-23 12:16:41
阅读次数:
8
string方法的一些函数作用 2.继承演示 -子类 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApp1 { /// <summary> /// 胡萝卜类:继承与蔬菜类。在这 ...
SHA1 VS RSA: what's the difference between them? Fundamentally different. SHA1 is a hash algorithm, which is a one way function, turning an input of a ...
分类:
其他好文 时间:
2020-11-23 12:09:41
阅读次数:
4
NGINX and the "Power of Two Choices" Load-Balancing Algorithm - NGINX https://www.nginx.com/blog/nginx-power-of-two-choices-load-balancing-algorithm/ ...
分类:
其他好文 时间:
2020-11-23 11:48:43
阅读次数:
4
题意:构造一个长度为n的数组,使得每个子数组中所有元素的和能被这个子数组的长度整除 解题思路:显然,构造一个元素全部相同的数组即可满足要求 代码: #include<iostream> #include<algorithm> #include<vector> #include<cstdio> #in ...
分类:
其他好文 时间:
2020-11-21 11:55:12
阅读次数:
6
一、事件定义类,即子窗体 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; ...
地址:https://www.acwing.com/problem/content/839/ 只是记录个板子,不做解析。 #include<cstdio> #include<cstring> #include<vector> #include<algorithm> #include<iostream ...
介绍next_permutation()是stl算法库中的方法,主要实现的是用字典序的方法求全排,具体算法后面补写。 下面是几个它的应用场景: 1.凑算式 A-G为1-9中各不相同的数,求有多少组合满足上式。 #include<stdio.h> #include<algorithm> #includ ...
分类:
编程语言 时间:
2020-11-13 12:22:10
阅读次数:
9