创建容器的选项

[root@mast ~]# docker container run --help

Usage:	docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
-a, --attach list Attach to STDIN, STDOUT or STDERR
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device list Block IO weight (relative device weight) (default [])
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cidfile string Write the container ID to the file
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
--cpu-rt-period int Limit CPU real-time period in microseconds
--cpu-rt-runtime int Limit CPU real-time runtime in microseconds
-c, --cpu-shares int CPU shares (relative weight)
--cpus decimal Number of CPUs
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
-d, --detach Run container in background and print container ID
--detach-keys string Override the key sequence for detaching a container
--device list Add a host device to the container
--device-cgroup-rule list Add a rule to the cgroup allowed devices list
--device-read-bps list Limit read rate (bytes per second) from a device (default [])
--device-read-iops list Limit read rate (IO per second) from a device (default [])
--device-write-bps list Limit write rate (bytes per second) to a device (default [])
--device-write-iops list Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--dns list Set custom DNS servers
--dns-option list Set DNS options
--dns-search list Set custom DNS search domains
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
--expose list Expose a port or a range of ports
--group-add list Add additional groups to join
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s)
--help Print usage
-h, --hostname string Container host name
--init Run an init inside the container that forwards signals and reaps processes
-i 交互式, --interactive Keep STDIN open even if not attached
--ip string IPv4 address (e.g., 172.30.100.104)
--ip6 string IPv6 address (e.g., 2001:db8::33)
--ipc string IPC mode to use
--isolation string Container isolation technology
--kernel-memory bytes Kernel memory limit
-l, --label list Set meta data on a container
--label-file list Read in a line delimited file of labels
--link list Add link to another container
--link-local-ip list Container IPv4/IPv6 link-local addresses
--log-driver string Logging driver for the container
--log-opt list Log driver options
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
-m, --memory bytes Memory limit
--memory-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
--mount mount Attach a filesystem mount to the container
--name string Assign a name to the container
--network string Connect a container to a network (default "default")
--network-alias list Add network-scoped alias for the container
--no-healthcheck Disable any container-specified HEALTHCHECK
--oom-kill-disable Disable OOM Killer
--oom-score-adj int Tune host's OOM preferences (-1000 to 1000)
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
--privileged Give extended privileges to this container
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
--read-only Mount the container's root filesystem as read only
--restart string Restart policy to apply when a container exits (default "no")
--rm Automatically remove the container when it exits
--runtime string Runtime to use for this container
--security-opt list Security Options
--shm-size bytes Size of /dev/shm
--sig-proxy Proxy received signals to the process (default true)
--stop-signal string Signal to stop a container (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory
-t, --tty 分配一个伪终端 Allocate a pseudo-TTY
--ulimit ulimit Ulimit options (default [])
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list Bind mount a volume
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s)
-w, --workdir string Working directory inside the container

  启动一个容器并在前台运行

[root@localhost ~]# docker run -it centos /bin/bash
[root@4279c14287c1 /]#

  后台创建一个容器

[root@localhost ~]# docker run -d centos
53dfa07e6f2c1f514cfe04c7943790692dd385e920ba56561c5b82160089fb33
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
53dfa07e6f2c centos "/bin/bash" 3 seconds ago Exited (0) 2 seconds ago unruffled_pare

  创建容器并设置端口映射-p 将容器端口映射成指定端口

[root@localhost ~]# docker run --name web -d -e test=123 -p 88:80  -h web  nginx
d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMESd2394de6c3a1 nginx "nginx -g 'daemon of…" 15 seconds ago
Up 11 seconds 0.0.0.0:88->80/tcp web[root@localhost ~]# ss -lntp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
users:(("sshd",pid=921,fd=3))LISTEN 0 100 127.0.0.1:25 *:*
users:(("master",pid=1310,fd=13))LISTEN 0 128 :::22 :::*
users:(("sshd",pid=921,fd=4))LISTEN 0 128 :::88 :::*
users:(("docker-proxy",pid=19507,fd=4))LISTEN 0 100 ::1:25 :::*
users:(("master",pid=1310,fd=14))

  进入后台运行的容器

[root@localhost ~]# docker exec -it web bash
root@web:/#

  将容器端口映射成随机的端口 -P

[root@localhost ~]# docker run -d --name web-1 -e test=chenxi -P -h cx nginx
a3bdc2062cd738acc717da093c5de736c2170d88a9fd310e0c0de0c20fdb855f
[root@localhost ~]# ss -lntp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
users:(("sshd",pid=921,fd=3))LISTEN 0 100 127.0.0.1:25 *:*
users:(("master",pid=1310,fd=13))LISTEN 0 128 :::32768 :::*
users:(("docker-proxy",pid=19781,fd=4))LISTEN 0 128 :::22 :::*
users:(("sshd",pid=921,fd=4))LISTEN 0 128 :::88 :::*
users:(("docker-proxy",pid=19507,fd=4))LISTEN 0 100 ::1:25 :::*
users:(("master",pid=1310,fd=14))

  创建容器设置容器允许使用500m内存,允许使用600m的swap分区,并禁用oom-kill

[root@localhost ~]# docker run --name web-9 --memory="500m" --memory-swap="600m" --oom-kill-disable -d -P nginx
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
25aff37e7dd0 nginx "nginx -g 'daemon of…" 7 minutes ago Up 7 minutes 0.0.0.0:32769->80/tcp web-9

   创建容器时设置容器最大使用一个半的cpu资源

[root@localhost ~]# docker run -d --name web-cx --cpus="1.5" -P nginx
0771848dd42e79499e6c43e28cecea79f03b80bae56daf7e1aa2c140304c2789
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES0771848dd42e nginx "nginx -g 'daemon of…" 15 seconds ago
Up 12 seconds 0.0.0.0:32770->80/tcp web-cx

  创建容器时设置容器最多使用半个cpu

[root@localhost ~]# docker run -d --name web-cx1 --cpus=".5" -P nginx
7638633dc06af3e335179e49b81a08959ec83e50362cb80f71188d652a86e37f
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES7638633dc06a nginx "nginx -g 'daemon of…" 4 seconds ago
Up 2 seconds 0.0.0.0:32771->80/tcp web-cx1

  动态查看容器的资源限制

[root@localhost ~]# docker stats web-cx

  

查看最后创建的一个容器

[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7638633dc06a nginx "nginx -g 'daemon of…" 16 minutes ago Up 16 minutes 0.0.0.0:32771->80/tcp web-cx1

 查看当前系统所有容器

[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7638633dc06a nginx "nginx -g 'daemon of…" 17 minutes ago Up 17 minutes 0.0.0.0:32771->80/tcp web-cx1
0771848dd42e nginx "nginx -g 'daemon of…" 20 minutes ago Up 20 minutes 0.0.0.0:32770->80/tcp web-cx
25aff37e7dd0 nginx "nginx -g 'daemon of…" About an hour ago Up About an hour 0.0.0.0:32769->80/tcp web-9
ab4b909c4e68 nginx "nginx -g 'daemon of…" About an hour ago Exited (0) About an hour ago cx
a3bdc2062cd7 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:32768->80/tcp web-1
d2394de6c3a1 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:88->80/tcp web
53dfa07e6f2c centos "/bin/bash" 2 hours ago Exited (0) 2 hours ago unruffled_pare
4279c14287c1 centos "/bin/bash" 2 hours ago Exited (127) 2 hours ago determined_chatterjee
dc2a611dae83 centos "/bin/bash" 2 hours ago Created reverent_elion

  查看当前运行的容器

[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7638633dc06a nginx "nginx -g 'daemon of…" 19 minutes ago Up 19 minutes 0.0.0.0:32771->80/tcp web-cx1
0771848dd42e nginx "nginx -g 'daemon of…" 21 minutes ago Up 21 minutes 0.0.0.0:32770->80/tcp web-cx
25aff37e7dd0 nginx "nginx -g 'daemon of…" About an hour ago Up About an hour 0.0.0.0:32769->80/tcp web-9
a3bdc2062cd7 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:32768->80/tcp web-1
d2394de6c3a1 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:88->80/tcp web

  查看容器详细信息

[root@localhost ~]# docker inspect web
[
{
"Id": "d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f",
"Created": "2019-02-22T02:09:09.984595885Z",
"Path": "nginx",
"Args": [
"-g",
"daemon off;"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 19532,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-02-22T02:09:12.789486607Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:f09fe80eb0e75e97b04b9dfb065ac3fda37a8fac0161f42fca1e6fe4d0977c80",
"ResolvConfPath": "/var/lib/docker/containers/d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f/hostname",
"HostsPath": "/var/lib/docker/containers/d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f/hosts",
"LogPath": "/var/lib/docker/containers/d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f/d2394de6c3a11151bfc1697493a8012a132763b2bfa045b55d7f657704e47f6f-json.log",
"Name": "/web",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"cad7ed32fa3444fb65f4dcf7007ce4af807b57554cb20325c57e38bc0ca4601c"
],
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "88"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/036314137e1525f686243ae5d6fd2861ab91e41d7bad36ac8a416aadb50e5302-init/diff:/var/lib/docker/overlay2/1491a86a89f7d4721b73639455d75fb153bc1
2c6cdaee687039d2e9317215741/diff:/var/lib/docker/overlay2/808c5a465c27497cb57ea709b083e855b6e11e2efa70887b1e3d6f2ece944ab3/diff:/var/lib/docker/overlay2/97f2bebcc1413f092415377b6d7e31dec473bd074f23afcde2d2394c65feed65/diff", "MergedDir": "/var/lib/docker/overlay2/036314137e1525f686243ae5d6fd2861ab91e41d7bad36ac8a416aadb50e5302/merged",
"UpperDir": "/var/lib/docker/overlay2/036314137e1525f686243ae5d6fd2861ab91e41d7bad36ac8a416aadb50e5302/diff",
"WorkDir": "/var/lib/docker/overlay2/036314137e1525f686243ae5d6fd2861ab91e41d7bad36ac8a416aadb50e5302/work"
},
"Name": "overlay2"
},
"Mounts": [],
"Config": {
"Hostname": "web",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"test=123",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NGINX_VERSION=1.15.8-1~stretch",
"NJS_VERSION=1.15.8.0.2.7-1~stretch"
],
"Cmd": [
"nginx",
"-g",
"daemon off;"
],
"ArgsEscaped": true,
"Image": "nginx",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"
},
"StopSignal": "SIGTERM"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "fe9ee0aed5e4eb0b9813211dc2d5fb27ee4bf03ea613b50e9c67d2e6d2204beb",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "88"
}
]
},
"SandboxKey": "/var/run/docker/netns/fe9ee0aed5e4",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "1ebbb49fc6565721fdb915fc659f4c5c5cb62c4b7b2190ad9a9aac3b3dbb2f0d",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "3b2c8016eb022a0e3a9896ff22b7aee66d3034fef8b301b91dc791ff184eef13",
"EndpointID": "1ebbb49fc6565721fdb915fc659f4c5c5cb62c4b7b2190ad9a9aac3b3dbb2f0d",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]

  交互式进入容器

[root@localhost ~]# docker exec -it web bash
root@web:/#

  利用容器创建镜像

[root@localhost ~]# docker commit web nginx:web4
sha256:58f1e3f2b46e047322fb302ca87d4c3748f02ba3609bac222ec7122937b0b030
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx web4 58f1e3f2b46e 28 seconds ago 109MB
nginx latest f09fe80eb0e7 2 weeks ago 109MB
centos latest 1e1148e4cc2c 2 months ago 202MB

  从宿主机往容器里复制文件

[root@localhost ~]# docker cp nginx-1.15.8.tar.gz web:/
[root@localhost ~]# docker exec -it web ls /
1 bin etc lib64 nginx-1.15.8.tar.gz root srv usr
12 boot home media opt run sys var
123 dev lib mnt proc sbin tmp

  查看指定容器里的进程

[root@localhost ~]# docker top web
UID PID PPID C STIME TTY TIME CMD
root 19532 19514 0 10:09 ? 00:00:00 nginx: master process nginx -g daemon off;
101 19565 19532 0 10:09 ? 00:00:00 nginx: worker process
root 19734 19514 0 10:11 pts/0 00:00:00 bash

  

docker 创建容器与管理容器的更多相关文章

  1. docker 创建.netcore2.2 api容器 以及连接mysql容器

    1]环境说明 操作系统:Window 10 专业版 开发工具 Vs2019专业版 Docker:  Docker for Windows  docker在windows上安装完毕之后可以看到 2]拉取 ...

  2. Docker创建Mysql容器并通过命令行连接到容器

    拉取网易蜂巢的mysql-server:5.6 docker pull hub.c.163.com/nce2/mysql:5.6 创建mysql5.6容器 1master+3个slave docker ...

  3. Docker 安全及日志管理

    Docker 安全及日志管理 容器的安全性问题的根源在于容器和宿主机共享内核. 容器里的应用导致Linux内核崩溃,那么整个系统可能都会崩溃. 虚拟机并没有与主机共享内核,虚拟机崩溃一般不会导致宿主机 ...

  4. Docker实践(二):容器的管理(创建、查看、启动、终止、删除)

    docker官方文档地址如下:[https://docs.docker.com/engine/reference/](https://docs.docker.com/engine/reference/ ...

  5. 2. docker 容器的管理(创建、查看、启动、终止、删除)

    一.创建 docker create:创建容器,处于停止状态. centos:latest:centos容器:最新版本(也可以指定具体的版本号). 本地有就使用本地镜像,没有则从远程镜像库拉取. 创建 ...

  6. Docker 创建容器以及管理命令(三)

    1. 创建 Apache 容器 [root@centos7 ~]# docker run -d -p : httpd // -d: 放入后台运行 // -p: 指定端口映射关系(第一个为本地端口.第二 ...

  7. Docker(七):Docker容器卷管理

    1.使用容器卷的原因:Docker容器产生的数据,如果不通过commit生成新的镜像,数据会在容器删除后丢失.为了能持久化保存和共享容器的数据,Docker提出了两种管理数据的方式:数据卷和数据卷容器 ...

  8. docker简单介绍----镜像和容器管理

    docker可以分为三部分:docker镜像   docker仓库  docker容器 docker镜像:一个image可以包含一个镜像,也可以理解为一个系统模板,里面安装了相关应用,也可以是纯净版的 ...

  9. Docker容器的管理

    创建容器的工作原理: 当利用docker run来创建容器时,Docker在后台运行的标准操作包括:检查本地是否存在指定的镜像,不存在就从公有仓库下载,利用镜像创建并启动一个容器分配一个文件系统,并在 ...

随机推荐

  1. bzoj4566

    后缀自动机+dp 一个串在另一个串上跑. 先对A建出自动机,然后用B在上面跑,记录当前匹配的最大长度,每次经过一个节点记录经过次数,并加上(len-Max(par))*Right,是这个状态对答案的贡 ...

  2. Linux学习—退出vi编辑模式

    转载自:http://blog.csdn.net/u010648555/article/details/50676647 初学Linux的时候,在使用vi 操作时候,有时候可能进入的是一个文件夹,这样 ...

  3. Cocos2d-x 3.2 创建新应用

    1.cd 到 Cocos2d-x 3.2 的目录: 2.python setup.py: 3.source /Users/netty/.bash_profile ; 4.cocos new TestP ...

  4. windows动态磁盘导致的分区问题

    上次说到由于装双系统导致我的win7启动不了了,一直以为是不是在ubuntu的安装界面点错了什么东西导致的,甚至认为是不是server的安装程序有点bug,直到今天继续折腾才发现了问题所在,跟ubun ...

  5. [WPF自定义控件库] 自定义控件的代码如何与ControlTemplate交互

    1. 前言 WPF有一个灵活的UI框架,用户可以轻松地使用代码控制控件的外观.例设我需要一个控件在鼠标进入的时候背景变成蓝色,我可以用下面这段代码实现: protected override void ...

  6. [Swift]有用的Binary Heap Type类

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  7. bzoj 4860 [BeiJing2017]树的难题

    题面 https://www.lydsy.com/JudgeOnline/problem.php?id=4860 题解 点分治 设当前重心为v 假设已经把所有边按照出发点第一关键字, 颜色第二关键字排 ...

  8. UvaLive6441(期望概率dp)

    1.涉及负数时同时维护最大和最小,互相转移. 2.考场上最大最小混搭转移WA,赛后发现如果是小的搭小的,大的搭大的就可过,类似这种: db a = (C[i] - W[i]) * dp1[i - ][ ...

  9. 洛谷 P3327 [SDOI2015]约数个数和 || Number Challenge Codeforces - 235E

    https://www.luogu.org/problemnew/show/P3327 不会做. 去搜题解...为什么题解都用了一个奇怪的公式?太奇怪了啊... 公式是这样的: $d(xy)=\sum ...

  10. 香港药品 ref

    --公牛牌风湿骨刺丹30粒 参考网站--http://item.jd.com/1955815605.html?gjz=0#comments-list 88 --参考网站1,没有 http://www. ...