自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(75)
  • 收藏
  • 关注

原创 解决Windows11安装Docker 一直starting 的办法

另外,docker desktop-unexpected wsl error问题跟标题问题好像是同一个问题,我的是一直让其starting到最后出现docker desktop-unexpected wsl error的弹窗提示。关闭docker 管理员身份执行wsl --update后在启动。

2023-12-30 21:38:05 3966

原创 qt在线安装登陆账户显示验证失败

退出,选择用管理员身份打开就可以了。

2023-10-31 13:25:41 1221

原创 1085: 战斗吧皇后!

在一个N*M的棋盘中,存在多少种方式使得两个皇后可以互相攻击。

2022-09-06 09:20:39 369 2

原创 结果填空:阶乘位数

思维||数学#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=5e5+5,tt=1000000;int a[N],b[N];int dd(ll x){ int s=0; while(x) { s++; x/=10; } return s;}int main(){ ios::sync_with_stdio(false); ll n; n=1;..

2022-04-08 10:39:48 155

原创 结果填空:加减乘

思想:搜索各种情况,进行判断#include<bits/stdc++.h>using namespace std;typedef long long ll;int a[11];int x[11],y[11];int n,m,s;void judge(){ int k=0,num=0,xx=1; for(int i=2; i<=10; i++) //先处理 * { if(a[i]==3) { num++; xx=xx*i; } el...

2022-04-08 10:28:06 268

原创 Maximum Sum of Products

给你两个长度为n的数组a和数组b。你可以反转数组a的一段连续区间。问操作后 a1 * b1 + a2 * b2+…+ an * bn的最大值为多少。Input第一行给出整数n,1<=n<=5000,第二行包含n个整数表示ai,1<=ai<=10^7。第三行包含n个整数表示bi,1<=bi<=10^7。Output打印一行整数表示反转一段数组a的区间后最大可以得到的和。ExamplesInput52 3 2 1 31 3 2

2022-03-17 19:42:17 397

原创 暗的连锁(​POJ 3417​)

原题来自:POJ 3417Dark 是一张无向图,图中有NN个节点和两类边,一类边被称为主要边,而另一类被称为附加边。Dark 有N - 1N−1条主要边,并且 Dark 的任意两个节点之间都存在一条只由主要边构成的路径。另外,Dark 还有MM条附加边。你的任务是把 Dark 斩为不连通的两部分。一开始 Dark 的附加边都处于无敌状态,你只能选择一条主要边切断。一旦你切断了一条主要边,Dark 就会进入防御模式,主要边会变为无敌的而附加边可以被切断。但是你的能力只能再切断 Dark ...

2022-03-06 10:41:40 394

原创 括号配对(LibreOJ - 10150)

Hecy 又接了个新任务:BE 处理。BE 中有一类被称为 GBE。以下是 GBE 的定义:空表达式是 GBE 如果表达式A是 GBE,则[A]与(A)都是 GBE 如果A与B都是 GBE,那么AB是 GBE下面给出一个 BE,求至少添加多少字符能使这个 BE 成为 GBE。思路:区间dp形式一般是固定的,三层for循环:最外层循环长度,中间层循环 左边界,最里层循环枚举左右边界之间,寻找最适中间点#include<bits/stdc++.h>...

2022-03-05 11:25:30 121

原创 L1-039 古风排版 (20 分)

中国的古人写文字,是从右向左竖向排版的。本题就请你编写程序,把一段文字按古风排版。输入格式:输入在第一行给出一个正整数N(<100),是每一列的字符数。第二行给出一个长度不超过1000的非空字符串,以回车结束。输出格式:按古风格式排版给定的字符串,每列N个字符(除了最后一列可能不足N个)。样例:">输入样例:4This is a test case输出样例:asa Tst ihe tsi ce s#include<bits/stdc++.

2022-03-05 08:59:51 62

原创 L1-049 天梯赛座位分配 (20 分)

L1-049 天梯赛座位分配 (20 分)天梯赛每年有大量参赛队员,要保证同一所学校的所有队员都不能相邻,分配座位就成为一件比较麻烦的事情。为此我们制定如下策略:假设某赛场有 N 所学校参赛,第 i 所学校有 M[i] 支队伍,每队 10 位参赛选手。令每校选手排成一列纵队,第 i+1 队的选手排在第 i 队选手之后。从第 1 所学校开始,各校的第 1 位队员顺次入座,然后是各校的第 2 位队员…… 以此类推。如果最后只剩下 1 所学校的队伍还没有分配座位,则需要安排他们的队员隔位就坐。本题就要求你编写

2022-03-05 08:45:11 78

原创 数字游戏

题目描述由于科协里最近真的很流行数字游戏,某人又命名了一种取模数,这种数字必须满足各位数字之和\bmod NmodN为00。现在大家又要玩游戏了,指定一个整数闭区间[a,b][a,b],问这个区间内有多少个取模数。输入格式题目有多组测试数据。每组只含三个数字a, b, Na,b,N。输出格式对于每个测试数据输出一行,表示各位数字和\bmod NmodN为00的数的个数。样例Input Output 1 19 9 2 ...

2022-01-15 20:25:41 2510

原创 加分二叉树

题目描述设一个nn个节点的二叉树\mathrm{tree}tree的中序遍历为(1,2,3,\cdots,n)(1,2,3,⋯,n),其中数字1,2,3,\cdots,n1,2,3,⋯,n为节点编号。每个节点都有一个分数(均为正整数),记第ii个节点的分数为d_idi​,\mathrm{tree}tree及它的每个子树都有一个加分,任一棵子树\mathrm{subtree}subtree(也包含\mathrm{tree}tree本身)的加分计算方法如下:记\mathrm...

2022-01-15 18:59:53 440

原创 石子合并

题目描述将nn堆石子绕圆形操场排放,现要将石子有序地合并成一堆。规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆的石子数记做该次合并的得分。请编写一个程序,读入堆数nn及每堆的石子数,并进行如下计算:选择一种合并石子的方案,使得做n-1n−1次合并得分总和最大。 选择一种合并石子的方案,使得做n-1n−1次合并得分总和最小。输入格式输入第一行一个整数nn,表示有nn堆石子。第二行nn个整数,表示每堆石子的数量。输出格式输出共两行:第一行为合并...

2022-01-15 11:06:57 155

原创 花神游历各国

线段树

2022-01-07 20:05:20 62

原创 点的距离

LCA

2022-01-06 20:37:19 107

原创 最大数(JSOI 2008)

st表,区间最值

2022-01-05 20:21:04 145

原创 天才的记忆

区间最值,ST表

2022-01-04 19:40:13 71

原创 「一本通 3.6 练习 5」Blockade

题目链接:https://loj.ac/p/10104解析:https://blog.csdn.net/qq_41856950/article/details/106691448https://blog.csdn.net/wwwengine/article/details/81975085

2022-01-03 20:22:28 170

翻译 「一本通 3.7 例 1」欧拉回路

https://loj.ac/p/10105#include<bits/stdc++.h>using namespace std;#define N 100100struct dd{ int v,to;} e[N<<2];int h[N],cnt=2,d1[N],d2[N];bool vis[N<<1];void Add(int u,int v){ e[cnt]=(dd){v,h[u]}; h[u]=cnt++; d1[u]++; d2[

2022-01-03 19:24:16 470

原创 受欢迎的牛

https://loj.ac/p/10091#include<bits/stdc++.h>using namespace std;const int N=10010,M=50010;int n,m,ans,du[N],id;int h[N],nxt[M],to[M],w[N],cnt;int dfn[N],low[N],q[N],top,belong[N];bool v[N],flag;struct Node{ int x,y;} s[M];void ins.

2021-12-05 09:14:19 186

原创 字符串排序

hihoCoder一般我们在对字符串排序时,都会按照字典序排序。当字符串只包含小写字母时,相当于按字母表"abcdefghijklmnopqrstuvwxyz"的顺序排序。 现在我们打乱字母表的顺序,得到一个26个字母的新顺序。例如"bdceafghijklmnopqrstuvwxyz"代表'b'排在'd'前,'d'在'c'前,'c'在'e'前…… 给定N个字符串,请你按照新的字母顺序对它们排序。Input第一行包含一个整数N。(1 <= N <= 1000)第二行包..

2021-11-30 10:33:52 824

原创 次短路

单源(即从顶点s到顶点t的最短路):问题链接:https://loj.ac/p/10076#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=2e5+5,inf=0x3f3f3f3f;int nxt[N],to[N],dis[N];int head[5005];int n,m,x,tot;int d2[5005],d1[5005];int ans;struct ..

2021-11-26 17:18:40 287

原创 N个有理数数求和

L1-009 N个数求和 (20 分)本题的要求很简单,就是求N个数字的和。麻烦的是,这些数字是以有理数分子/分母的形式给出的,你输出的和也必须是有理数的形式。输入格式:输入第一行给出一个正整数N(≤100)。随后一行按格式a1/b1 a2/b2 ...给出N个有理数。题目保证所有分子和分母都在长整型范围内。另外,负数的符号一定出现在分子前面。输出格式:输出上述数字和的最简形式 —— 即将结果写成整数部分 分数部分,其中分数部分写成分子/分母,要求分子小于分母,且它们没有公因子。如果结果

2021-11-21 17:24:35 468

原创 PTA.7-2后缀式求值

我们人类习惯于书写“中缀式”,如3 + 5 * 2,其值为13。 (p.s. 为什么人类习惯中缀式呢?是因为中缀式比后缀式好用么?)而计算机更加习惯“后缀式”(也叫“逆波兰式”,Reverse Polish Notation)。上述中缀式对应的后缀式是:3 5 2 * +现在,请对输入的后缀式进行求值。输入格式:在一行中输入一个后缀式,运算数和运算符之间用空格分隔,运算数长度不超过6位,运算符仅有+ - * /四种。输出格式:在一行中输出后缀式的值,保留一位小数。输入样例...

2021-11-21 16:01:46 2036 4

原创 Intersection(线段相交)

You are to write a program that has to decide whether a given line segment intersects a given rectangle.An example:line: start point: (4,9)end point: (11,2)rectangle: left-top: (1,5)right-bottom: (7,1)Figure 1: Line segment does not intersect r.

2021-10-20 21:22:28 184

原创 线段树模板

区间查询,区间修改单点修改,单点查询#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>typedef long long ll;using namespace std;const int N=1e6;ll sum[N<<2],b[N<<2];//b[]用作标记 /* 根据需求,数组的定义形式并不单一 可以定义成 ..

2021-10-19 20:43:42 28

原创 Packets(思维)

A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parcels of the same height h as the products have and of the size 6*6. B

2021-10-05 22:01:39 103

原创 Swap(二分图)

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?InputThere are several test cases in the input. The first line of each test case is an int

2021-10-05 20:33:48 41

转载 Cheapest Palindrome(区间dp)

Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows pass by a scanner. Each ID tag's contents are currently a singl

2021-10-04 20:26:22 59

转载 CQXYM Count Permutations(思维)

CQXYM is counting permutations length of2n2n.A permutation is an array consisting ofnndistinct integers from11tonnin arbitrary order. For example,[2,3,1,5,4][2,3,1,5,4]is a permutation, but[1,2,2][1,2,2]is not a permutation (22appears twice i...

2021-10-04 10:28:07 179

原创 Easy Scheduling

Eonathan Eostar decided to learn the magic of multiprocessor systems. He has a full binary tree of tasks with heighthh. In the beginning, there is only onereadytask in the tree— the task in the root. At each moment of time,ppprocesses choose at m...

2021-10-03 21:07:33 57

原创 Making the Grade

A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but they are not fond of an alternating succession of hills and valleys. FJ would like to add

2021-10-03 20:28:58 142

原创 字典树

题目链接:http://#10050. 「一本通 2.3 例 2」The XOR Largest Pair#include<bits/stdc++.h>using namespace std;const int N = 1e5 + 10, M = 31 * N;int a[N];int son[M][2],idx;//idx建字典树时给每一节点做标号void insert(int x){ int p = 0; for(int i = 30; i >= 0;...

2021-10-01 18:17:02 64

转载 数列分段||

对于给定的一个长度为N的正整数数列A[i],现要将其分成M(M≤N)段,并要求每段连续,且每段和的最大值最小。关于最大值最小:例如一数列4 2 4 5 1要分成3段将其如下分段:[4 2][4 5][1]第一段和为6,第2段和为9,第3段和为1,和最大值为9。将其如下分段:[4][2 4][5 1]第一段和为4,第2段和为6,第3段和为6,和最大值为6。并且无论如何分段,最大值不会小于6。所以可以得到要将数列4 2 4 5 1要分成3段,每段和的最大值最小为6。输入输入文件divide_b.i

2021-09-25 09:03:05 148

原创 kmp和next

前两道kmp的应用InputThe first line of the input file contains a single number: the number of test cases to follow. Each test case has the following format:One line with the word W, a string over {'A', 'B', 'C', …, 'Z'}, with 1 ≤ |W| ≤ 10,000 (here |W| denot

2021-09-09 21:04:37 33

原创 三种博弈模板

威佐夫博弈:原理:https://blog.csdn.net/qq_41311604/article/details/79980882有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行..

2021-09-09 20:39:39 76

原创 A Simple Problem with Integers

You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.InputThe first li...

2021-08-22 17:28:25 38

原创 树状数组三种模板

单点修改,区间查询:给定数列a1,a2,…,ana1,a2,…,an,你需要依次进行qq个操作,操作有两类:1 i x:给定i,xi,x,将aiai加上xx; 2 l r:给定l,rl,r,求∑ri=lai∑i=lrai的值(换言之,求al+al+1+⋯+aral+al+1+⋯+ar的值)。输入格式第一行包含22个正整数n,qn,q,表示数列长度和询问个数。保证1≤n,q≤1061≤n,q≤106。第二行nn个整数a1,a2,…,ana1,a2,…,a...

2021-08-21 19:31:16 123

原创 超快速排序

在这个问题中,您必须分析特定的排序算法----超快速排序。该算法通过交换两个相邻的序列元素来处理nn个不同整数的序列,直到序列按升序排序。对于输入序列9 1 0 5 4,超快速排序生成输出0 1 4 5 9。您的任务是确定超快速排序需要执行多少交换操作才能对给定的输入序列进行排序。输入格式输入包括一些测试用例。每个测试用例的第一行输入整数nn,代表该用例中输入序列的长度。接下来nn行每行输入一个整数aiai,代表用例中输入序列的具体数据,第ii行的数据代表序列...

2021-08-21 18:42:56 155

原创 Network of Schools

A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving schools”). Note that if B is in the distribution list of s

2021-08-10 10:22:02 70

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除