题意 给出一个整数列,求一段子序列之和最接近所给出的t.输出该段子序列之和及左右端点. Input The input file contains several test cases. Each test case starts with two numbers n and k. Input is terminated by n=k=0. Otherwise, 1<=n<=100000 and there follow n integers with absolute values <…
Description Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, not meters!"). Each signal seems to…
题意: 输入 n m 之后输入n个数 之后m个询问 对于每个询问 输入一个t 输出 三个数 ans l r 表示从l 到 r的所有数的和的绝对值最接近t 且输出这个和ans 思路:就是指针的移动. AC代码: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<limits…
Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5207 Accepted: 1667 Special Judge Description Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration…
Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 2277 Accepted: 703 Special Judge Description Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration…
描述 http://poj.org/problem?id=2566 给出一个整数序列,并给出非负整数t,求数列中连续区间和的绝对值最接近k的区间左右端点以及这个区间和的绝对值. Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 2592 Accepted: 789 Special Judge Description Signals of most probably extra-terrestr…
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, not meters!"). Each signal seems to come in two…
http://poj.org/problem?id=2566: Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 2237 Accepted: 692 Special Judge Description Signals of most probably extra-terrestrial origin have been received and digitalized by The Aero…
传送门 NanoApe Loves Sequence Ⅱ Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 1585 Accepted Submission(s): 688 Description NanoApe, the Retired Dog, has returned back to prepare for for the…
题目链接: 传送门 Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive intege…
题目链接: 传送门 They Are Everywhere time limit per test:2 second memory limit per test:256 megabytes Description Sergei B., the young coach of Pokemons, has found the big house which consists of n flats ordered in a row from left to right. It is possib…
Description Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas included in a very thick text book. The au…
D. Longest k-Good Segment 题目连接: http://www.codeforces.com/contest/616/problem/D Description The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-good if it conta…
题目链接:HDU5806 题意:找出有多少个区间中第k大数不小于m. 分析:用尺取法可以搞定,CF以前有一道类似的题目. #include<cstdio> using namespace std; typedef long long ll; #define d\n I64d\n ]; ll ans; int main() { scanf("%d",&T); while (T--) { scanf("%d%d%d",&n,&m,&a…