二分
楚江枫
不忘初心,方得始终
展开
-
【zzulioj 1919 二分】
二分 Description给一颗树,有n个结点,编号为1到n,1为根节点,有两种操作,1 x y把x结点权值加y,2 x查询x到根节点所有结点的权值和. 每个结点权值初始化为0。Input第一行输入一个整数t,代表有t组测试数据。 每组数据第一行为两个整数n,m代表结点个数和操作次数。 接下来n-1行,每行两个整数a,b,表示a结点和b结点有一条边。 接下来m行每行一个操作格式如上。 0原创 2016-08-17 20:22:27 · 367 阅读 · 0 评论 -
【Codeforces 760 B Frodo and pillows】+ 二分
B. Frodo and pillows time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputn hobbits are planning to spend the night at Frodo’s house. Frod原创 2017-01-25 01:37:15 · 1376 阅读 · 0 评论 -
【Codeforces 778 A String Game】+ 二分
A. String Game time limit per test2 seconds memory limit per test512 megabytes inputstandard input outputstandard output Little Nastya has a hobby, she likes to remove some letters from word, to o原创 2017-02-26 21:14:52 · 763 阅读 · 0 评论 -
【Codeforces 782 B The Meeting Place Cannot Be Changed】+ 二分
B. The Meeting Place Cannot Be Changed time limit per test5 seconds memory limit per test256 megabytes inputstandard input outputstandard output The main road in Bytecity is a straight line from s原创 2017-03-06 18:16:15 · 727 阅读 · 0 评论 -
【Codeforces Gym 100187F 】+ 贪心
Doomsday comes in t units of time. In anticipation of such a significant event n people prepared m vaults in which, as they think, it will be possible to survive. But each vault can accommodate only k原创 2017-03-20 21:49:29 · 530 阅读 · 0 评论 -
【HDU 4004 The Frog's Games】+ 二分
The Frog’s Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 7219 Accepted Submission(s): 3461Problem Description The annual Games in原创 2017-04-30 20:50:44 · 574 阅读 · 0 评论 -
【Codeforces 808 D. Array Division】+ 二分
D. Array Division time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vasya has an array a consisting of positive integer numbers. Vasya wants原创 2017-05-21 22:14:26 · 663 阅读 · 0 评论 -
【Codeforces 817C. Really Big Numbers】+ 二分
C. Really Big Numbers time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Ivan likes to learn different things about numbers, but he is especia原创 2017-06-17 20:58:57 · 549 阅读 · 0 评论 -
【Codeforces 812 C. Sagheer and Nubian Market】+ 二分
C. Sagheer and Nubian Market time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output On his trip to Luxor and Aswan, Sagheer went to a Nubian mark原创 2017-06-07 23:19:35 · 530 阅读 · 0 评论 -
【HDU 6070 Dirt Ratio】 二分 & 线段树
Dirt RatioTime Limit: 18000/9000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 1275 Accepted Submission(s): 568 Special JudgeProblem Description In ACM/ICPC原创 2017-08-04 20:42:36 · 380 阅读 · 0 评论 -
【codeforces 706B Interesting drink】+ 二分
Interesting drink B. Interesting drink time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vasiliy likes to rest after a hard work, so you ma原创 2016-08-15 19:06:35 · 336 阅读 · 0 评论 -
【POJ 2112 Optimal Milking】网络流 & 二分 & floyd
Optimal Milking Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 18478 Accepted: 6594 Case Time Limit: 1000MS DescriptionFJ has moved his K (1 <= K <= 30) milking machines out原创 2017-10-02 16:35:54 · 319 阅读 · 0 评论 -
【Codeforcdes 237C. Primes on Interval】+ 二分
C. Primes on Interval time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputYou’ve decided to carry out a survey in the theory of prime num原创 2016-12-09 22:35:52 · 538 阅读 · 0 评论 -
【Codeforces 729 C Road to Cinema】 + 二分
C. Road to Cinema time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputVasya is currently at a car rental service, and he wants to reach c原创 2016-11-23 20:51:29 · 585 阅读 · 0 评论 -
【zzulioj 1917 二分+vector】
Description晴天有非常严重的选择恐惧症,每次吃饭前他都在纠结到底吃什么。。今天又到了吃饭的时候了。重光:我给你一个包含n个不同整数的序列a,如果它所有连续子序列的价值和是素数咱们就吃米,不然就吃面。定义一个序列的价值为序列中所有元素的最小值。晴天:这不是分分钟给你算出来。嗯…十分钟过去了,晴天选择死亡。这个任务就交给你啦。算出所有连续子序列的价值和。Input第一行输入一个整数t,代表有t原创 2016-08-18 19:55:06 · 348 阅读 · 0 评论 -
【zzulioj 1912 小火山的爱情密码】
小火山的爱情密码Description小火山获得了一个字符串,然而大火山让小火山从里面截取一段字符串,并且让小火山截取的字符串满足一些字符达到一定数量。 小火山觉得很容易,但是他想要知道他至少得截取多长的字符串。 Input首先是一个整数t(t<=100),表示测试数据组数。接下来是两个整数n和m(n<=10000, m<=10),n表示字符串的长度,m表示要满足一定数量的字符 的种类.(字符原创 2016-08-19 17:56:44 · 503 阅读 · 0 评论 -
【nyoj 1291 音痴又音痴的LT 二分】
音痴又音痴的LT音痴又音痴的LT 时间限制:4000 ms | 内存限制:65535 KB 描述 LT最近一直在无限循环薛之谦的歌,简直都中毒了!可是呢…他的歌LT还是不会唱(其实不止他的歌LT不会唱,所有人的歌LT都不会唱…因为LT是标准的音痴)可是LT又很喜欢唱歌(所以LT不仅是音痴还是音痴)…没错,这对于LT的室友来说简直是噩梦… 现在呢,LT有N次操作,每次操作只会有两种原创 2016-08-20 17:10:49 · 390 阅读 · 0 评论 -
【LightOJ 1138 Trailing Zeroes (III)】
Trailing Zeroes (III) You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*…*N. For example, 5! = 120, 120 contains原创 2016-08-23 21:51:06 · 438 阅读 · 0 评论 -
【LightOJ 1307 + 二分】
LightOJ 1307Description You are given N sticks having distinct lengths; you have to form some triangles using the sticks. A triangle is valid if its area is positive. Your task is to find the number o原创 2016-09-22 07:56:47 · 520 阅读 · 0 评论 -
【 Codeforces 237C Primes on Interval】+ 二分
A - Primes on Interval Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatus Description You’ve decided to carry out a survey in the theory of prime numbers. Le原创 2016-10-16 15:35:58 · 407 阅读 · 0 评论 -
【POJ 1064 Cable master】+ 二分
Cable master Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 39607 Accepted: 8474Description Inhabitants of the Wonderland have decided to hold a regional programming contest.原创 2016-11-15 23:36:12 · 322 阅读 · 0 评论 -
【POJ 2456 Aggressive cows】+ 二分
Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11881 Accepted: 5808Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The s原创 2016-11-15 23:58:24 · 319 阅读 · 0 评论 -
【Codeforces 734 C Anton and Making Potions 】+ 思维
C. Anton and Making Potions time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard outputAnton is playing a very interesting computer game, but n原创 2016-12-02 18:36:02 · 638 阅读 · 0 评论 -
【HPU 1193 Interval】+ 二分 + 思维
1193: Interval [STL、双指针、二分] 时间限制: 2 Sec 内存限制: 128 MB 提交: 61 解决: 12 [提交][状态][讨论版] 题目描述才发现编故事背景那么难,原谅当初语文考满分的我。对于区间L,R 而言,它的长度是R−L+1,区间和则是a[L]+…+a[R]。(如果用数组a去记录)注意:区间元素的下标是从1开始的。如:序列(5,2,1,1,3,1,4原创 2016-12-05 21:51:37 · 415 阅读 · 0 评论