上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 给定长度为N的数列A,以及M条指令,指令为一下两种之一: 1. C L R d 表示把A[L],A[L+1].....A[R]都加上d 2. Q L R 表示查询 A[L]......A[R]的最大公约数 对于每个询问输出一个答案; 这个题算是经典的线段树的问题了,因为:区间修改+区间查询 这道题好 阅读全文
posted @ 2022-04-24 15:09 empty_y 阅读(98) 评论(0) 推荐(0)
摘要: 1 # include<iostream> 2 # include<cstring> 3 # include<algorithm> 4 using namespace std; 5 const int N = 110; 6 7 int e[N], ne[N], idx; 8 int h[N]; 9 阅读全文
posted @ 2022-04-13 00:07 empty_y 阅读(46) 评论(0) 推荐(0)
摘要: 1 # include<iostream> 2 # include<cstring> 3 using namespace std; 4 const int N = 55; 5 int ne[N]; 6 7 char s[N],T[N]; 8 /*s为字串,T为主串*/ 9 int main(){ 1 阅读全文
posted @ 2022-04-12 10:07 empty_y 阅读(37) 评论(0) 推荐(0)
摘要: Codeforces Round #781 C. Tree Infection time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A 阅读全文
posted @ 2022-04-09 11:17 empty_y 阅读(173) 评论(0) 推荐(1)
摘要: 1 # include<stdio.h> 2 # include<string.h> 3 # include<malloc.h> 4 # include<stdlib.h> 5 6 int peopleid = 20220200;/*最初的管理员编号*/ 7 int bookid = 0200200 阅读全文
posted @ 2022-04-04 13:59 empty_y 阅读(527) 评论(0) 推荐(0)
摘要: 菜鸡第一次打icpc 记录一下历程 习惯#define int long long 以下皆是按照我认为的难易顺序排序 K. 看题意大概就是说求从L加到R 1 ios::sync_with_stdio(false); 2 cin.tie(nullptr); 3 cout.tie(nullptr); 4 阅读全文
posted @ 2022-04-04 12:37 empty_y 阅读(96) 评论(0) 推荐(0)
摘要: 1 # include<iostream> 2 # include<stdio.h> 3 # include<algorithm> 4 # include<string> 5 using namespace std; 6 /*建树的过程和二叉树大差不差*/ 7 const int N = 10001 阅读全文
posted @ 2022-04-04 11:57 empty_y 阅读(36) 评论(0) 推荐(0)
摘要: # include<iostream># include<cstring># include<algorithm>using namespace std;const int N = 200010;typedef long long ll;/* 树状数组的主要目的是利用树形结构来优化前缀和 使得前缀和 阅读全文
posted @ 2022-03-09 22:02 empty_y 阅读(45) 评论(0) 推荐(1)
摘要: 1 # include<stdio.h> 2 # include<malloc.h> 3 typedef struct node { 4 int data;/*数据域*/ 5 struct node * next; /*指针域*/ 6 } node, *pnode; /*栈节点*/ 7 8 type 阅读全文
posted @ 2022-03-05 17:37 empty_y 阅读(131) 评论(0) 推荐(0)
摘要: # include<stdio.h># include<malloc.h> typedef struct node{ int data; struct node *next;}node,*pnode;;int n;/*初始节点数目*/pnode creatlist();/*创建一个链表*/void 阅读全文
posted @ 2022-03-02 19:49 empty_y 阅读(202) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页