
二分+双指针
文章平均质量分 60
做不完的ACM
加油,努力
展开
-
CCPC.2017B.K-th Number
#include using namespace std;typedef long long ll;const int N = 1E5 + 7;int a[N], b[N], n, k;ll m;bool fuck(int x){ ll res = 0; int sum = 0, pre=1, last; for(last = 1;last <= n;las原创 2017-11-12 18:26:54 · 424 阅读 · 0 评论 -
51NOD1267(4个数和为0)
给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。 Input 第1行,1个数N,N为数组的长度(4 <= N <= 1000)第2 - N + 1行:A[i](-10^9 <= A[i] <= 10^9) Output 如果可以选出4个数,使得他们的和为0,...原创 2018-04-03 23:00:01 · 187 阅读 · 0 评论 -
Codeforces 939E(三分)
E. Maximize!time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a multiset S consisting of positive integers (initially empty). There ar...原创 2018-04-25 01:46:29 · 380 阅读 · 0 评论 -
Codeforces 1006C
题目链接:http://codeforces.com/contest/1006/problem/C题意:把一个数组分成L, MID, R三段, 每段都可以为空,求可以使SUML = SUMR 的最大SUML值。代码:#include <bits/stdc++.h>using namespace std;using ll = long long ;cons...原创 2018-07-17 10:15:28 · 293 阅读 · 0 评论