上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页
摘要: 题解:用一个for,循环m次,每次都把最前面的放到最后面,就可以了。#include #include #include const int maxn = 1000000;struct node{ int *elem; int len;};void C... 阅读全文
posted @ 2018-09-04 10:00 Mercury_Lc 阅读(104) 评论(0) 推荐(0)
摘要: 题解: 每次询问一遍,如果已经存在就不用插入表中了。#include #include #include struct node{ int *elem; int len;};void CreatList(int m, struct node &list){... 阅读全文
posted @ 2018-09-04 09:25 Mercury_Lc 阅读(108) 评论(0) 推荐(0)
摘要: 题解: 每次询问一遍,如果已经存在就不用插入表中了。#include #include #include struct node{ int *elem; int len;};void CreatList(int m, struct node &list){... 阅读全文
posted @ 2018-09-04 09:25 Mercury_Lc 阅读(216) 评论(0) 推荐(0)
摘要: Problem 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果... 阅读全文
posted @ 2018-08-29 21:24 Mercury_Lc 阅读(146) 评论(0) 推荐(0)
摘要: Problem 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果... 阅读全文
posted @ 2018-08-29 21:24 Mercury_Lc 阅读(73) 评论(0) 推荐(0)
摘要: 题解:隔一段数字存一个答案,在查询时,只要找到距离n最近而且小于n的存答案值,再把剩余的暴力跑一遍就可以。#include using namespace std;const int N = 1e8 + 10;const int M = 2e6 + 10;double... 阅读全文
posted @ 2018-08-28 21:06 Mercury_Lc 阅读(205) 评论(0) 推荐(0)
摘要: Problem You are given an array of N integers and Q queries. Each query is a closed interval [l, r]. You should find the minimum absolu... 阅读全文
posted @ 2018-08-27 20:37 Mercury_Lc 阅读(139) 评论(0) 推荐(0)
摘要: Problem You are given an array of N integers and Q queries. Each query is a closed interval [l, r]. You should find the minimum absolu... 阅读全文
posted @ 2018-08-27 20:37 Mercury_Lc 阅读(91) 评论(0) 推荐(0)
摘要: 离线算法算法设计策略都是基于在执行算法前输入数据已知的基本假设,也就是说,对于一个离线算法,在开始时就需要知道问题的所有输入数据,而且在解决一个问题后就要立即输出结果,通常将这类具有问题完全信息前提下设计出的算法成为离线算法( off line algorithms)... 阅读全文
posted @ 2018-08-27 19:41 Mercury_Lc 阅读(426) 评论(0) 推荐(0)
摘要: 离线算法算法设计策略都是基于在执行算法前输入数据已知的基本假设,也就是说,对于一个离线算法,在开始时就需要知道问题的所有输入数据,而且在解决一个问题后就要立即输出结果,通常将这类具有问题完全信息前提下设计出的算法成为离线算法( off line algorithms)... 阅读全文
posted @ 2018-08-27 19:41 Mercury_Lc 阅读(181) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页