恢复内容开始 题意:给一个长度为n的序列ai,每次从ai中挑出一个数字走ai步(不能重复用),对应坐标也增加ai.问你有多少种方案走完ai这个序列,且中途没有坐标停留在给定的 数字k上(k是一个或者是两个)。n=24 思路:n=24,非常微妙的数字。首先n!的算法的上界是11,所以全排列是不能用的。 ...
分类:
其他好文 时间:
2021-04-22 16:02:54
阅读次数:
0
#include <stdio.h> #include <iostream> using namespace std; class abc { private: int a; int b; }; int main() { cout << "Hello, World!" << endl; cout < ...
分类:
其他好文 时间:
2021-04-22 15:25:05
阅读次数:
0
题目大意 给一个二叉树的中序遍历和前序遍历,求其镜像后的层序遍历 类似于 L2-006 树的遍历 (25 分) 建树 镜像就在dfs的时候先输出右子树 再 左子树 #include<bits/stdc++.h> using namespace std; struct node { int l,r; ...
分类:
其他好文 时间:
2021-04-21 12:12:05
阅读次数:
0
CodeForces-1178F1 Short Colorful Strip 区间DP 题意 给定$0-n$ 一共 $n+1$种颜色,现有$m$段初始时刻颜色都是0的纸,对这张纸的段进行操作,第$i$次操作会选择第$l$段到第$r$段纸进行区间染色,条件是这段此时必须为同种颜色,染为$i$。给出最终 ...
分类:
其他好文 时间:
2021-04-21 11:55:16
阅读次数:
0
爆搜,按照题意来搜。。。 太难写了,当模拟写的,代码分成了很多块,长度比较难看。。。 #include<bits/stdc++.h> using namespace std; #define ll long long #define fastio ios::sync_with_stdio(false ...
分类:
其他好文 时间:
2021-04-20 15:37:24
阅读次数:
0
所谓并查集就是将编号为1~n的n个对象划分为不相交集合,在每个集合中,选择其中的某个元素代表所在集合在这个集合中,并查集的操作有初始化,合并,查找。 #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_std ...
分类:
其他好文 时间:
2021-04-20 15:31:02
阅读次数:
0
我对模拟退火的初步理解,还没深入了解过。这里只是用模拟退火求函数极值。 题目:https://vjudge.net/problem/HDU-2899 #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_std ...
分类:
编程语言 时间:
2021-04-20 15:29:36
阅读次数:
0
#基数排序 也是采用分桶的思想,但是加入了按位比较的思想(可以理解为每位进行一次计数排序) 思路: 计算数列中最大位数 按位数循环处理每位的排序 代码实现: #include<iterator> #include<iostream> #include<vector> using namespace ...
分类:
编程语言 时间:
2021-04-20 15:17:05
阅读次数:
0
创建线程 #include<iostream> #include<windows.h> using namespace std; DWORD WINAPI PROCESST1(LPVOID param); DWORD WINAPI PROCESST2(LPVOID param); DWORD WIN ...
定义一个学生类,包含学号、姓名、成绩等属性。(1)使用重载函数定义多个构造函数。(2)使用默认参数定义构造函数。 #include<iostream> #include<string> using namespace std; class Student { public: Student(){ n ...
分类:
编程语言 时间:
2021-04-20 14:48:10
阅读次数:
0