题意 给出一个整数列,求一段子序列之和最接近所给出的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 <…
题意: 输入 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…
传送门 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…