链接:https://pintia.cn/problem-sets/994805046380707840/problems/1336215880692482060 思路: 代码: #include<bits/stdc++.h> using namespace std; vector<int>ve[1 ...
分类:
其他好文 时间:
2021-04-24 13:26:55
阅读次数:
0
后缀数组构造方法: 1.倍增 直接参考刘汝佳蓝书 时间复杂度不优秀,但代码实现简单,细节处理较多,建议参考思路后背过代码。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring ...
分类:
编程语言 时间:
2021-04-24 13:23:55
阅读次数:
0
考个研真的把很多东西都忘光了,,, #include <string_view> #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; class Sampl ...
分类:
其他好文 时间:
2021-04-23 12:18:50
阅读次数:
0
做法:记录每个点i向左与它最近的不互质的数j,从j+1到i是可以分成1块的。 对于每次询问,从r开始一直贪心往前跳,每跳一步ans++;但这样一步一步跳会T,需要去倍增优化。 #include<bits/stdc++.h> using namespace std; #define ll long l ...
分类:
其他好文 时间:
2021-04-23 12:09:38
阅读次数:
0
typeid操作符可以用来获取一个类型/表达式的名称: #include <iostream> #include <typeinfo> using namespace std; int main() { std::cout << typeid(int).name() << std::endl; re ...
分类:
其他好文 时间:
2021-04-23 12:05:50
阅读次数:
0
原题链接 考察:搜索 思路: 预处理有子弹和城堡的坐标,这部分除了暴力没有更好的办法.因为还有一个时间限制,所以需要三维数组.剩下就是BFS. 剪枝: 1.相同时间的拜访点不必再访问. 2.当离终点的曼哈顿距离>能量 不必再走下去. 注意:城堡处一定要预处理再判断子弹. 1 #include <io ...
分类:
其他好文 时间:
2021-04-22 16:32:51
阅读次数:
0
A Tit for Tat 题意:给你一个n个数的数组,在k次操作下,每次可以选2个数,一个+1,一个-1,求如何让数组前面的数最小,后面的数最大。最小不能为0. 思路:模拟,把前面的数-掉都加在最后一个数上 #include<iostream> using namespace std; int n ...
分类:
其他好文 时间:
2021-04-22 16:23:39
阅读次数:
0
此处双指针代表的是一种思想,即两个(或多个)"先锋"动态式跟随并进行信息交流[个人理解],样例如下: 先输入数组大小,然后依次赋值(按照升序) ①若不得有重复元素,代码如下: 1 #include<iostream> 2 using namespace std; 3 4 const int N = ...
分类:
编程语言 时间:
2021-04-22 16:22:56
阅读次数:
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
c语言中continue语句;执行continue语句后,循环体的剩余部分就会被跳过。 例子; 1、原始程序。输出矩形。 #include <stdio.h> int main(void) { int i, j, height, width; puts("please input the heigh ...
分类:
编程语言 时间:
2021-04-22 15:24:21
阅读次数:
0