摘要: 大意:有一个大矩形,每次可以横着切或者竖着切,给你n个小矩形,问你原来的大矩形的宽高 思路:可以发现,最多有两种可能,找到所给矩形的宽和高的最大值,模拟check() 知识点:LL H=*max_element(a.begin(), a.end());数组最大值 ve.emplace_back(H, 阅读全文
posted @ 2023-06-02 22:26 xxj112 阅读(33) 评论(0) 推荐(0)
摘要: 大意加思路:相当于有一个绳子,其中有n段可以上色,如果要给一段上色代价增加2,没向前走一步代价加一,可以看出代价最多可以去对掉长度为一的段落,因为最后要给x个点上色代价做少为x,而前面的段落给1个点上色代价最少为2,另外要考虑最后一段可能没有完全上色。 点击查看代码 ``` #include usi 阅读全文
posted @ 2023-06-01 21:32 xxj112 阅读(28) 评论(0) 推荐(0)
摘要: 大意:有一个数组a,其中a[i]> dp(n+1,vector((1 点击查看代码 ``` #include using namespace std; typedef long long LL; typedef pair PLL; #define IOS cin.tie(nullptr)->sync 阅读全文
posted @ 2023-06-01 20:34 xxj112 阅读(10) 评论(0) 推荐(0)
摘要: 题解:值域分治,降低时间复杂度到 n*1000+map 代码1: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> PLL; #define IOS cin. 阅读全文
posted @ 2023-04-28 20:44 xxj112 阅读(31) 评论(0) 推荐(0)
摘要: 题解:数组a存储答案,数组p存储剩余位置,每次的到抛弃的数d,如果d大于其中一个则数组满足,放置位置数组p更新为0,数组a更新为d,空余的位置更新为max(d); 另外 ,每次输入d迭代下最大值ma,与最后胜利者比较。 代码: 点击查看代码 #include<bits/stdc++.h> using 阅读全文
posted @ 2023-04-22 21:58 xxj112 阅读(59) 评论(0) 推荐(0)
摘要: X服从参数n、p的二项分布记作 : X~b(n,p); 泊松定理 : n*p=$\lambda$ $$ \lim_{n \to +\infty} {k \choose n}P_0^\infty {k \choose n}(1-p_n)^(n-k) $$ 松柏分布 :$X$~$P$$(\lambda> 阅读全文
posted @ 2023-04-13 22:38 xxj112 阅读(68) 评论(0) 推荐(0)
摘要: Δ=b2−4ac$$\Delta=b^2-4ac$$ $$\Delta=b^2-4ac$$ $$\begin{matrix} 1 & x & x^2 \ 1 & y & y^2 \ 1 & z & z^2 \end{matrix}$$ $$\Delta=b^2-4ac$$ $$ \left[ \be 阅读全文
posted @ 2023-04-10 21:10 xxj112 阅读(18) 评论(0) 推荐(0)
摘要: 第一次进1000还是很开心的,rating分也上1500,不过还是很菜,得继续努力,现在上分的最主要困难是,英语,太卡脖子了,好好学英语。 阅读全文
posted @ 2023-04-03 12:23 xxj112 阅读(16) 评论(0) 推荐(0)
摘要: 题解在代码里,如下 点击查看代码 #include<bits/stdc++.h> typedef long long LL; using namespace std; //如果一个数n不是质数,就一定有非一的因数x<=sqrt(n); const int N=5e4; //因为所给题目最大到(1<< 阅读全文
posted @ 2023-03-31 20:55 xxj112 阅读(112) 评论(0) 推荐(0)
摘要: 点击查看代码 using namespace std; typedef long long LL; typedef pair<string,int> PLL; #define IOS cin.tie(nullptr)->sync_with_stdio(false); #define se secon 阅读全文
posted @ 2023-03-30 21:56 xxj112 阅读(29) 评论(0) 推荐(0)