二分/三分
junior19
abcde
展开
-
CF1117C. Magic Ship(二分)
C. Magic Shiptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou a captain of a ship. Initially you are standing in a point (x1,...原创 2019-02-21 11:19:35 · 306 阅读 · 0 评论 -
HDU5289:Assignment(二分 + ST表)
AssignmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4288 Accepted Submission(s): 1971Problem DescriptionTom owns a comp原创 2017-07-24 21:15:52 · 277 阅读 · 0 评论 -
CodeChef:Travel to all Points(二分 & 技巧)
思路:二分答案,O(n)验证,|p-x|+|q-y| >= d可互达,相当于(P+Q)-(X+Y)>=D(P+Q)-(X+Y)(P-Q)-(X-Y)>=D(P-Q)-(X-Y)任一种情况都可互达,那么设置两个数组分别对x+y和x-y排序,BFS看是否能够到达所有点即可,参考作者题解。# include # define mp make_pairusing namespa原创 2017-08-16 14:08:52 · 197 阅读 · 0 评论 -
FZU2203:单纵大法好(二分)
Problem 2203 单纵大法好Accept: 229 Submit: 709Time Limit: 5000 mSec Memory Limit : 65536 KB Problem Description人在做,天在看,单纵不怂保平安众娘皆为轮回来,敢教POI进夜战。勿怪战列低智商,航母不是一个样?假摔不虚有损管,大破进击是真相!原创 2017-06-10 19:43:47 · 241 阅读 · 0 评论 -
ZJCOJ:qwb与支教(二分)
Problem A: qwb与支教Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 1454 Solved: 266[Submit][Status][Web Board]Descriptionqwb同时也是是之江学院的志愿者,暑期要前往周边地区支教,为了提高小学生的数学水平。她把小学生排成一排,从左至右从1开始依次往原创 2017-06-02 22:35:04 · 360 阅读 · 0 评论 -
CodeChef:Consecutive Snakes(三分)
It's the annual military parade, and all the soldier snakes have arrived at the parade arena, But they aren't standing properly. The entire parade must be visible from the main podium, and all the sna原创 2017-06-01 00:20:18 · 273 阅读 · 0 评论 -
CF689D:Friends and Subsequences(ST表 + 二分)
D. Friends and Subsequencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMike and !Mike are old childhoo原创 2017-05-20 12:09:52 · 404 阅读 · 0 评论 -
AtCoder:Widespread(二分)
D - WidespreadTime limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem StatementYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a原创 2017-06-05 10:59:39 · 905 阅读 · 0 评论 -
CodeChef:A temple of Snakes(思维 & 二分)
You want to build a temple for snakes. The temple will be built on a mountain range, which can be thought of as n blocks, where height of i-th block is given by hi. The temple will be made on a cons原创 2017-05-30 14:11:59 · 330 阅读 · 0 评论 -
CF803D:Magazine Ad(二分)
D. Magazine Adtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main city magazine offers its readers an原创 2017-05-16 16:18:07 · 479 阅读 · 0 评论 -
CF83B:Doctor(二分)
B. Doctortime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n animals in the queue to Dr. Dolittle.原创 2017-08-13 19:34:52 · 533 阅读 · 0 评论 -
CodeChef:Chef and Problems(分块 & 二分)
Chef was invited to the party of N people numbered from 1 to N. Chef knows the growth of all the people, i.e. he knows the growth of the ith person is denoted by an integer Ainot exceeding M.Che原创 2017-08-21 00:20:13 · 774 阅读 · 0 评论 -
AGC018:Sports Festival(二分)
B - Sports FestivalTime limit : 2sec / Memory limit : 256MBScore : 700 pointsProblem StatementTakahashi is hosting an sports meet. There are N people who will participate. These原创 2017-07-29 11:10:16 · 477 阅读 · 0 评论 -
HDU6261:Rikka with Mutex(二分 + 贪心)
Rikka with MutexTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 132 Accepted Submission(s): 28 Problem DescriptionSometimes, techni...原创 2018-07-18 17:13:37 · 317 阅读 · 0 评论 -
POI2010:ANT-Antisymmetry(二分 + HASH)
题目描述Byteasar studies certain strings of zeroes and ones.Let be such a string. By we will denote the reversed (i.e., "read backwards") string , and by we will denote the string obtained from by...原创 2018-07-23 23:07:48 · 613 阅读 · 0 评论 -
ARC092:Two Sequences(二进制 & 二分)
Problem StatementYou are given two integer sequences, each of length N: a1,…,aN and b1,…,bN.There are N2 ways to choose two integers i and j such that 1≤i,j≤N. For each of these N2 pairs, we will comp...原创 2018-04-15 20:08:02 · 409 阅读 · 0 评论 -
51nod1962:区间计数(分治 & 二分)
1962 区间计数 基准时间限制:1.5 秒 空间限制:262144 KB 分值: 80 难度:5级算法题 收藏 关注两个数列 {An} , {Bn} ,请求出Ans, Ans定义如下:Ans:=Σni=1Σnj=i[max{Ai,Ai+1,...,Aj}=max{Bi,Bi+1,...,Bj}] 注:[ ]内表达式为真,则为1,否则为0.1≤N≤3.5×1051≤Ai,Bi≤N 样例解释:7个区...原创 2018-02-23 18:21:44 · 399 阅读 · 0 评论 -
数据结构期末复习:排序算法
图片来源toptal 本文用几种排序算法演示对一个大小为20的数组排序,主要参考课本《C++数据结构与算法(第四版)》,数组下标默认从0开始。插入排序复杂度O(n2)O(n^2) 先对前ii个数排好序,对于第i+1i+1个数,不断将前面的数后移11位,直到找到合适的位置插进去。 # include <iostream>using namespace std;void insertion_s原创 2017-12-12 16:18:20 · 563 阅读 · 1 评论 -
CodeChef:Desik And Divisors(数学 & 二分 & 思维)
Given two integers L and K. You are to find the minimum integer R such that Sum of the number of divisors of all numbers from L to R is greater than K.InputFirst Line specifies an integer T, the numbe...原创 2017-12-03 19:00:12 · 197 阅读 · 0 评论 -
CF888E:Maximum Subsequence(中途相遇)
E. Maximum Subsequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a consisting o原创 2017-11-10 08:54:44 · 762 阅读 · 0 评论 -
HDU5317:RGCDQ (数学 & 二分)
Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more interesting things about GCD. Today He comes up with Range Greatest Common Divisor Query (RGCDQ). What’s RGCDQ? P原创 2017-10-23 22:33:17 · 204 阅读 · 0 评论 -
SPOJ:Zero Query(分块 & 二分)
Given an array having N elements, each element is either -1 or 1.You have M queries, each query has two numbers L and R, you have to answer the length of the longest subarray in range L to R (incl原创 2017-08-21 13:29:24 · 683 阅读 · 0 评论 -
CF806C:Prairie Partition(二分)
C. Prairie Partitiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt can be shown that any positive inte原创 2017-05-23 23:45:53 · 330 阅读 · 0 评论 -
HDU2298:Toxophily(三分 + 二分)
ToxophilyTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2068 Accepted Submission(s): 1147Problem DescriptionThe recreation c原创 2017-04-06 17:19:41 · 236 阅读 · 0 评论 -
HDU4768:Flyer(二分)
FlyerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3094 Accepted Submission(s): 1150Problem DescriptionThe new semester beg原创 2017-02-22 23:24:57 · 365 阅读 · 0 评论 -
CF524C:The Art of Dealing with ATM(打表 + 二分)
C. The Art of Dealing with ATMtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputATMs of a well-known bank of原创 2017-03-02 11:18:15 · 385 阅读 · 0 评论 -
CF448D:Multiplication Table(二分)
D. Multiplication Tabletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBizon the Champion isn't just charmi原创 2017-02-22 00:06:18 · 348 阅读 · 0 评论 -
HDU3714:Error Curves(三分)
Error CurvesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5434 Accepted Submission(s): 2054Problem DescriptionJosephina is原创 2017-03-01 22:56:38 · 216 阅读 · 0 评论 -
CF779D:String Game(二分)
D. String Gametime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputLittle Nastya has a hobby, she likes to remo原创 2017-03-01 13:37:36 · 386 阅读 · 0 评论 -
HDU5178:pairs(二分法 & 尺取法)
pairsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2497 Accepted Submission(s): 930Problem DescriptionJohn has n points o原创 2017-02-12 00:42:38 · 962 阅读 · 0 评论 -
HDU1496:Equations(二分)
EquationsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8166 Accepted Submission(s): 3354Problem DescriptionConsider equatio原创 2017-02-19 11:43:46 · 273 阅读 · 0 评论 -
HDU4737:A Bit Fun(二分)
A Bit FunTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3079 Accepted Submission(s): 1535Problem DescriptionThere are n numb原创 2017-02-19 00:02:46 · 273 阅读 · 0 评论 -
HDU2899:Strange fuction(二分 + 数学)
Strange fuctionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6874 Accepted Submission(s): 4807Problem DescriptionNow, here原创 2017-02-18 22:50:12 · 187 阅读 · 0 评论 -
HDU5248:序列变换(二分)
序列变换Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1348 Accepted Submission(s): 593Problem Description给定序列A={A1,A2,...,An},原创 2017-02-23 22:30:17 · 499 阅读 · 0 评论 -
POJ1064:Cable master(二分)
Cable masterTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 42080 Accepted: 9010DescriptionInhabitants of the Wonderland have decided to hold a region原创 2017-02-23 23:26:09 · 225 阅读 · 0 评论 -
HRBUST2381:MOD(二分)
ModTime Limit: 1000 MSMemory Limit: 100000 KTotal Submit: 362(100 users)Total Accepted: 133(89 users)Rating: Special Judge: NoDescriptionKim原创 2017-02-01 23:23:46 · 281 阅读 · 0 评论 -
POJ3579:Median(二分)
MedianTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6929 Accepted: 2321DescriptionGiven N numbers, X1, X2, ... , XN, let us calculate the difference原创 2017-03-24 12:59:31 · 257 阅读 · 0 评论 -
lightoj1240:Point Segment Distance (3D)(三分)
1240 - Point Segment Distance (3D) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven a segment in 3D space, identified by A(原创 2017-03-23 17:04:59 · 642 阅读 · 0 评论 -
CF680D:Bear and Tower of Cubes(二分 + 数学)
D. Bear and Tower of Cubestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little polar bear. He原创 2017-03-04 00:14:26 · 354 阅读 · 0 评论 -
POJ3273:Monthly Expense(二分)
Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 24725 Accepted: 9613DescriptionFarmer John is an astounding accounting wizard and has r原创 2017-03-03 20:21:42 · 203 阅读 · 0 评论