Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27358 Accepted Submission(s): 7782 Problem Description JGShining's kingdom consists of 2n(n is no mor
之前一直是用二分 但是因为比较难理解,写的时候也容易忘记怎么写. 今天比赛讲评的时候讲了一种用树状数组求LIS的方法 (1)好理解,自然也好写(但代码量比二分的大) (2)扩展性强.这个解法顺带求出以i为结尾的LIS,而很多题要用到这个数组来做 而二分的做法求得是当前长度下的最小值,不容易拓展. #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for
pog loves szh II Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2106 Accepted Submission(s): 606 Problem Description Pog and Szh are playing games.There is a sequence with n numbers, Pog wi
#include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> #include<cmath> using namespace std; const int maxn=1e5+5; int is1[maxn],is2[maxn];// is1为原数组,is2为临时数组,n为个人定义的长度 long long merge(int low,int mid,int
Description Alice is playing a game with Bob. Alice shows N integers a 1, a 2, …, a N, and M, K. She says each integers 1 ≤ a i ≤ M. And now Alice wants to ask for each d = 1 to M, how many different sequences b 1, b 2, …, b N. which satisfies : 1. F