#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef long long ll; const int N=1e5+10; struct node{ ...
分类:
其他好文 时间:
2020-02-11 09:27:57
阅读次数:
52
//线段树区间覆盖 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int N=100010; int flag; struct node{ in ...
分类:
其他好文 时间:
2020-02-11 09:25:59
阅读次数:
54
//add,懒标记,给以当前节点为根的子树中的每一个点加上add(不包含根节点) // #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef ...
分类:
其他好文 时间:
2020-02-11 09:22:13
阅读次数:
70
CodeForces - 1201B 首先和是偶数,最大的数要小于总和的一半 #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> ...
分类:
其他好文 时间:
2020-02-10 19:51:56
阅读次数:
72
/* 虽然题目没说,但是读入有以下特点 由于,输入是按照按照y递增,如果y相同则x递增的顺序给出的 所以,可以利用入读的时间进行降为处理 */ 于是我们就得到了一个一维的树状数组解法啦 值得一提:坐标从0~32000,而树状数组是从1开始的 于是,我们对所有下标+1,数组开到32002就可以啦! 1 ...
分类:
编程语言 时间:
2020-02-10 19:41:13
阅读次数:
55
A. Non-zero 思路:如果数组中有0,那么乘积肯定为0,因此我们只要统计0的个数,给每个0加上1即可,之后还需考虑给所有0机上1和为0的情况,此时要再加上1 #include<iostream> #include<algorithm> using namespace std; int mai ...
分类:
其他好文 时间:
2020-02-10 13:45:19
阅读次数:
62
A:读进来就把0搞成1,S!=0就直接输出,S=0判一下有没有不是-1的,有不是-1的就+1否则+2。 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #define it register int 5 #define ...
分类:
其他好文 时间:
2020-02-10 09:44:19
阅读次数:
73
solution 这个题其实还是比较暴力的 关键在于对于每个方阵的处理(其实还是对处理要求比较细的 首先我们得明确搜索的顺序:是从左上到右下的,所以有一些畸形的情况不需要考虑 我们只要check 每一个方正是不是满的就行了 时刻更新最大的节点处 ...
分类:
其他好文 时间:
2020-02-10 09:34:15
阅读次数:
48
Dec 30, 2019 ~ Jan 5, 2020 Algorithm Problem 88 Merge Sorted Array (合并两个有序数组) "题目链接" 题目描述:给定两个有序数组 nums1,nums2,其长度分别为m,n。假设 nums1 有足够的空间(m+n),将 nums2 ...
分类:
其他好文 时间:
2020-02-09 20:49:28
阅读次数:
77
#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; typedef long long ll; const int N=1e5+10; int a[N]; int ...
分类:
编程语言 时间:
2020-02-09 20:45:45
阅读次数:
68