尺取+枚举,推出公式以后就是一个枚举加尺取 但是这题的尺取不是对一个值尺取,而是在一个区间内,所以固定左边界,尺取右边界即可 #include<bits/stdc++.h> #define maxn 100005 #define ll long long using namespace std; int t,n,m,k,x,y,z,l,tot; ll cnt,sum[maxn]; int a[maxn]; ll solve(ll L,ll R){//求区间[l,R)内i+j的和 ll ans=
Minimum Sum Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3769 Accepted Submission(s): 872 Problem Description You are given N positive integers, denoted as x0, x1 ... xN-1. Then give you
Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5101 Accepted Submission(s): 2339 Problem Description Mario is world-famous plumber. His “burly” figure and amazing jumping abilit
No Pain No Game Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2000 Accepted Submission(s): 851 Problem Description Life is a game,and you lose it,so you suicide. But you can not kill yours
Group Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1959 Accepted Submission(s): 1006 Problem Description There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i