![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
尺取法
czyhbo
这个作者很懒,什么都没留下…
展开
-
codeforces1166C - A Tale of Two Lands
传送题目大意:给定一个序列 ,在序列中找两个数x,y,使得|x-y|,|x+y| 在数轴中覆盖掉|x|,|y|, 问该序列中有多少对这种数。方法:尺取法正负无关,先排序,然后尺取的时候,注意ans加的是尺取出来的子序列的长度#include<cstdio>#include<cstring>#include<string>#include<iostream>#include<cmath>#include<algorithm&原创 2020-07-09 08:56:08 · 204 阅读 · 0 评论 -
codeforces 372A. Counting Kangaroos is Fun
A. Counting Kangaroos is Fun time limit per test 1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaro原创 2020-07-08 11:59:30 · 282 阅读 · 0 评论 -
Jessica‘s Reading Problem
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 author of that text原创 2020-07-08 08:14:46 · 257 阅读 · 0 评论 -
codeforces1352 E. Special Elements
Pay attention to the non-standard memory limit in this problem.In order to cut off efficient solutions from inefficient ones in this problem, the time limit is rather strict. Prefer to use compiled statically typed languages (e.g. C++). If you use Python,原创 2020-07-07 19:10:55 · 263 阅读 · 0 评论 -
codeforce701 C. They Are Everywhere
C. They Are Everywheretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSergei B., the young coach of Pokemons, has found the big house which consists of n flats ordered in a row from left to r..原创 2020-07-07 12:11:15 · 149 阅读 · 0 评论