输入输出格式一定要与样例一样,连一个空格,逗号都不能少,否者就会报错。 C++代码如下: #include <iostream> #include <vector> #include <string> #include <map> using namespace std; int main() { ...
分类:
其他好文 时间:
2020-07-29 17:46:11
阅读次数:
95
1004.Tokitsukaze and Multiple 求和为p的倍数的块的最大数量 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register in ...
分类:
其他好文 时间:
2020-07-29 17:32:55
阅读次数:
99
AcWing 826. 单链表 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int e[N],ne[N],head,idx; //初始化 void init(){ head=-1; idx=0; } //将x插到 ...
# 命名元组 from collections import namedtuple subscriber = namedtuple(typename='Subscriber', field_names=['name', 'age']) sub = subscriber('lisi', 10) pri ...
分类:
其他好文 时间:
2020-07-29 15:09:12
阅读次数:
62
1.从docker容器中生成镜像 docker commit 容器名 镜像名 容器名(docker ps -a 查看的names下的名字) 镜像名(docker imaes 下REPOSITORY 下的名字) 2. 将docker镜像导出为静态文件,也就是tar包 docker save 镜像名 > ...
分类:
其他好文 时间:
2020-07-29 12:46:27
阅读次数:
74
#ifndef MY_BIGN_H#define MY_BIGN_H 1#pragma GCC system_header#include<cstring>#include<algorithm>#include<iostream>using std::max;using std::istream;u ...
分类:
其他好文 时间:
2020-07-28 16:52:02
阅读次数:
67
AcWing 790. 数的三次方根 #include <bits/stdc++.h> using namespace std; int main(){ double n,mid; scanf("%lf",&n); double l=-1e6-10,r=1e6+10; while(r-l>1e-8) ...
AcWing 795. 前缀和 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int a[N],S[N]; int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=1 ...
:将每行输入的数字转换为十进制,然后预处理出所有满足题意的状态并存储于 sta ,再处理出单独一行时候的方案数并存储于 dp1,sta 枚举第 i 行的状态,判断第 j = i-1行的状态,并更新dpi , j ,最后累和即可 #include <bits/stdc++.h> using names ...
分类:
其他好文 时间:
2020-07-28 14:10:58
阅读次数:
62
题目 传送门 思路 如果暴力背包必然会T, 但是机房巨佬JZM好像直接用DP过了 我们考虑,如果只有1和2两种重量 我们可以用一个$log$来处理出答案 先用重量为2暴力填入背包, 我们考虑将价值最小的一个重量为2的推出背包意味着价值最大的两个重量为1的物品价值之和大于重量为2的最小价值 这很显然是 ...
分类:
其他好文 时间:
2020-07-28 00:26:23
阅读次数:
88