``` cpp include using namespace std; const int N = 2e+7 + 5; struct Pt { int a, b, c; int id; bool operator ma, mb, mc; int aa[N], ab[N], ac[N]; int i ...
分类:
其他好文 时间:
2019-11-03 11:15:22
阅读次数:
108
这题目描述的不是很清楚,没有说明是每次更新“即时生效”还是每次更新“批量生效”,做过题目的应该能明白我我说的意思。 ...
分类:
其他好文 时间:
2019-11-03 10:40:43
阅读次数:
74
"exgcd" 贝祖定理推广 贝祖定理可以推广到n个,n =2 ax+by+cz+...=k if(k%gcd(a,b,c,...)==0) 该式子有整数解 else 没有整数解 "Forsaken喜欢数论" 因为空间限制,直接省略掉sum数组 记得sum 开long long! ? 线性基 定义 ...
分类:
其他好文 时间:
2019-11-03 10:31:02
阅读次数:
114
1 #include<stdio.h> 2 3 int main(void) 4 { 5 double length; 6 int time; 7 double money; 8 9 scanf_s("%lf %d", &length, &time); 10 11 if (length <= 3) ... ...
分类:
其他好文 时间:
2019-11-03 10:29:54
阅读次数:
78
原题链接在这里:https://leetcode.com/problems/last-stone-weight-ii/ 题目: We have a collection of rocks, each rock has a positive integer weight. Each turn, we ...
分类:
其他好文 时间:
2019-11-03 10:27:37
阅读次数:
81
原题链接在这里:https://leetcode.com/problems/last-stone-weight/ 题目: We have a collection of rocks, each rock has a positive integer weight. Each turn, we cho ...
分类:
其他好文 时间:
2019-11-03 10:26:45
阅读次数:
81
"题目链接" 描述 【题解】 "一个讲得比较好的博客地址" ; 感觉manacher算法的大概思路就是利用回文串左右对称的性质。 利用之前算出来的以某个点为中心的回文串。而当前要枚举的串被包括在其中。 则可以用左半部分的结果来获取右边当前的串的结果。 O(N) 当然也可以枚举中间点在哪个地方然后O( ...
分类:
其他好文 时间:
2019-11-03 01:18:02
阅读次数:
75
//int转16进制 (long类型同样) int a=90; string str= convert.tostring(a,16); //5a //int转2进制 int a=90; string str= convert.tostring(a,2); //1011010 //int转byte i... ...
https://vjudge.net/problem/Gym-102346M 一般来说, 若题目要求输出一个确定的数( 比如最小天数,最大个数之类 ),用二分来枚举答案试试。 ...
分类:
其他好文 时间:
2019-11-03 00:58:00
阅读次数:
132
一.分支的基本语法 单if ~~~ if表达式: 语句1 语句2 …… ~~~ 2.条件表达式就是计算结果必须为布尔值得表达式 3.表达式后面的冒号不能少 4.注意if后面出现的语句,如果属于if语句块,则必须同一个缩进等级 5.条件表达式结果为True执行if后面的缩进语句块 双向分支 ~~~ i ...
分类:
编程语言 时间:
2019-11-02 23:41:39
阅读次数:
73