- 博客(18)
- 收藏
- 关注
原创 2021-07-22
Code Feat UVA - 11754 题目链接 中国剩余定理+暴力 #include<iostream> #include<algorithm> #include<vector> #include<set> using namespace std; typedef long long ll; const ll maxn=20; const ll maxk=120; const ll limit=1e4; ll total; ll C,S; ll A[ma
2021-07-22 20:02:22
238
原创 HZNU Dec. Team Training 2题解
HZNU Dec. Team Training 2 A - Amateur Chess Players(Gym - 102606A) 题意:一个棋盘,Cuber QQ有n个棋和Quber CC有m个棋,没人可以拿同一条直线的棋子,每次至少拿一个,Cuber QQ先手,谁拿不了谁就输。 要想赢,每次只拿一个,就比较n,m。 代码: #include<map> #include<set> #include<list> #include<cmath> #includ
2020-12-05 13:22:52
384
原创 Vector、Sort课后题解
Vector、Sort课后题解 HZNU OJ 2004 Description 今天是六一儿童节,ACM队的某些人比如说yl臭不要脸的想要过节。为此,wxa买了很多大白兔糖分给大家,但是想要得到这些糖必须回答出wxa的题目。他在每颗糖上标有数字,第一个找到数字K的人,将得到糖。zz想得到糖,但是眼力不好,你能帮帮他快速的找到标号为K的糖吗?(题目保证K一定存在) Input 第一行输入一个T,表示有T组测试样例。 对于每组测试样例第一行输入n,k。第二行输入n个数据(n<10000),代表n颗糖的
2020-08-15 10:08:01
1417
原创 Vector、Sort视频题解
Vector、Sort视频题解 HZNU OJ 1030 Description 给出一个包含N个数的序列,对这个序列进行增删和打印操作。 Input 输入包含T组测试数据。 开头是一个正整数T (0<T<10),为测试数据数量。 对于每组测试数据,第一行是一个正整数N (0<N<=100000)。 第二行是N个正整数,代表这个序列中的N个元素。每个元素均小于10000。 第三行是一个正整数Q (0<Q<=20) 代表操作次数。接下来有Q行,若为增添操作,格式为“U i
2020-08-15 09:21:17
380
原创 洛谷 P1301 魔鬼之城
P1301 魔鬼之城 #include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<cstdlib> #include<cstring>
2020-08-10 14:23:00
301
原创 计蒜客 - A1542
计蒜客 - A1542 #include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<cstdlib> #include<cstring>
2020-08-03 19:44:09
224
原创 HDU--1045 Fire Net(二分图)
HDU–1045 Fire Net(二分图) Problem Description Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall. A blockhouse is a small castle that has four op
2020-08-03 19:40:40
202
原创 HDU--2819 Swap(二分图)
HDU–2819 Swap(二分图) Problem Description Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1? Input There are several test cases in the input. The f
2020-08-03 19:39:11
141
原创 L3-015 球队“食物链
L3-015 球队“食物链” (30分) 注意:每两支队伍打2场比赛,主场客场。 #include<iostream> #include<cmath> #include<string> #include<queue> #include<cstring> #include<list> #include<map> #include<set> #include<cstdio> #include<ve
2020-07-22 09:23:32
117
原创 树状数组
单点更新区间查询 int n; int a[1005],c[1005]; //对应原数组和树状数组 int lowbit(int x){ return x&(-x); } void updata(int i,int k){ //在i位置加上k while(i <= n){ c[i] += k; i += lowbit(i); } } int getsum(int i){ //求A[1 - i]的和 int
2020-07-20 13:51:05
111
原创 线段树与树状数组 H题
POJ 3321 Apple Tree 线段树与树状数组 H题 There is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree. The tree has N forks which are connecte
2020-07-20 13:38:00
144
原创 P1149 火柴棒等式
P1149 火柴棒等式//dfs 回溯 https://www.luogu.com.cn/problem/P1149 #include<iostream> #include<cmath> #include<string> #include<queue> #include<cstring> #include<list> #include<map> #include<set> #include<vector&
2020-07-18 09:08:41
109
原创 L3-010 是否完全二叉搜索树 (30分)
L3-010 是否完全二叉搜索树 (30分) https://pintia.cn/problem-sets/994805046380707840/problems/994805049870368768 将一系列给定数字顺序插入一个初始为空的二叉搜索树(定义为左子树键值大,右子树键值小),你需要判断最后的树是否一棵完全二叉树,并且给出其层序遍历的结果。 输入格式: 输入第一行给出一个不超过20的正整数N;第二行给出N个互不相同的正整数,其间以空格分隔。 输出格式: 将输入的N个正整数顺序插入一个初始为空的二叉
2020-07-17 18:38:55
193
原创 P1305 新二叉树
P1305 新二叉树 题意:题目没讲清楚,第一个结点总是根节点 #include<iostream> #include<cmath> #include<string> #include<queue> #include<cstring> #include<list> #include<map> #include<set> #include<vector> #include<stack> #
2020-07-17 10:35:18
98
原创 洛谷P1040 加分二叉树
洛谷P1040 加分二叉树 https://www.luogu.com.cn/problem/P1040 题意 n个结点的二叉树中序遍历为1~n; i个节点的分数为 di; 子树分数=左子树*右子树+根的分数 输出最高得分和前序遍历 #include<iostream> #include<cmath> #include<string> #include<queue> #include<cstring> #include<list>
2020-07-17 10:17:54
136
原创 树的遍历
7-11 玩转二叉树 (25分) 给定一棵二叉树的中序遍历和前序遍历,请你先将树做个镜面反转,再输出反转后的层序遍历的序列。所谓镜面反转,是指将所有非叶结点的左右孩子对换。这里假设键值都是互不相等的正整数。 输入格式: 输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其中序遍历序列。第三行给出其前序遍历序列。数字间以空格分隔。 输出格式: 在一行中输出该树反转后的层序遍历的序列。数字间以1个空格分隔,行首尾不得有多余空格。 输入样例: 7 1 2 3 4 5 6 7 4 1 3 2 6
2020-07-16 18:34:05
211
原创 HZNU-1597 矩阵寻数
HZNU-1597 矩阵寻数 题目:HZNU-1597 矩阵寻数 题意:输入整数n,输入n*n矩阵,找出绝对值最大的数,输出数的绝对值及下标。 AC代码: #include<stdio.h> #include<math.h> int main(){ int n; scanf("%d",&n); int a[10][10]; int maxx,maxxi,maxxj; /* maxx 最大值 maxxi 最大值的行坐标 maxxj 最大值的
2020-07-06 11:34:24
517
原创 HZNU_OJ 2094 这道题是简单题
HZNU_OJ 2094 这道题是简单题 题目:http://acm.hznu.edu.cn/OJ/problem.php?id=2094 图片: 带尺寸的图片: 居中的图片: 居中并且带尺寸的图片: #include<iostream> using namespace std; const int maxn=1e5+10; int a[maxn]; int main(){ int n; int maxx,minn; cin>>n; int x; for(int i
2020-06-28 12:09:42
1565
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅