We have N bulbs arranged on a number line, numbered 1 to N from left to right. Bulb i is at coordinate i. Each bulb has a non-negative integer paramet ...
分类:
其他好文 时间:
2020-06-15 15:42:11
阅读次数:
80
一、CentOS 安装教程(https://shimo.im/docs/YHdpx1MbG8EJj04M/ ) 二、Docker 环境初始化(https://shimo.im/docs/4jHdhoQQe0k8uhtd/) 三、Docker之利用Nginx部署HTML站点(https://shimo ...
分类:
其他好文 时间:
2020-06-15 15:32:33
阅读次数:
81
一.fork系统调用 在Linux内核中,一般用fork系统调用创建新进程,被创建的进程称之为子进程。linux下fork系统调用是通过_do_fork()来实现的。进程的创建过程大致是父进程通过fork系统调用进入内核_do_fork函数,复制进程描述符以及相关进程资源,为子进程分配内核堆栈,并对 ...
分类:
系统相关 时间:
2020-06-15 12:06:58
阅读次数:
59
背景 618来临之际,为了应对一些突发流量,购买了两台一个月的ECS用来临时对部分项目扩容。其中一个项目有用到雪花算法来生成Id,这个还是挺OK的。 不过发现要在配置文件中手动配置机器码!!配置的时候还要先知道目前配置了那些,这样才可以避免重复。 经过了解,除了会有单机单实例的情况,还会有单机多实例 ...
分类:
编程语言 时间:
2020-06-15 09:24:29
阅读次数:
289
Caesar Cipher ####题意: 凯撒密码加密,输出对应的密文的明文 ####思路: 加密是将明文向右移位,那么解密就是将密文向左移位。 注意:A向左一位是Z #include<bits/stdc++.h> #define ll long long using namespace std; ...
分类:
其他好文 时间:
2020-06-14 16:40:15
阅读次数:
54
Power Tower ###题意: 一个序列有$n$个数,$q$次询问,将$l$到$r$这个区间的数叠起来模上$M$ ###思路: 欧拉降幂 #include<bits/stdc++.h> #define ll long long using namespace std; map<ll,ll>mp ...
分类:
其他好文 时间:
2020-06-14 16:24:18
阅读次数:
66
题目链接:http://poj.org/problem?id=1958 代码: #include<iostream> #include<cstring> using namespace std; #define maxn 100 typedef long long ll; ll d[maxn],f[ ...
分类:
编程语言 时间:
2020-06-14 12:57:40
阅读次数:
82
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; int ans1; int ans2; int ans3 ...
分类:
其他好文 时间:
2020-06-14 12:57:25
阅读次数:
164
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; vector<int>v[1001000],ans; i ...
分类:
其他好文 时间:
2020-06-14 12:35:49
阅读次数:
64
题目链接 点我呀 翻译 给你3条边x, y, z的范围, 且满足x < y < z, 让你选出3条合法的边, 使得这3条边能组成三角形。 保证答案总是存在。 题解 因为x < y < z, 所以x(y)和z相加的话, 肯定是大于y(x)的。 因此只要判断x+y是不是大于z就可以了。 因为说了一定会有 ...
分类:
其他好文 时间:
2020-06-14 10:41:15
阅读次数:
64