思维
文章平均质量分 90
Chen_Jr_
某个正在奋斗的ACMer
展开
-
HDU 4334(思维+二分答案)
传送门题面:TroubleTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6560 Accepted Submission(s): 1847Problem Description Hassan is in trouble. His ...原创 2018-05-09 12:46:28 · 624 阅读 · 0 评论 -
Codeforces 1005D(dp)
传送门题面: D. Polycarp and Div 3time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp likes numbers that are divisible by 3...原创 2018-07-11 17:51:00 · 277 阅读 · 0 评论 -
HDU 6301 (2018多校第一场D)(双指针贪心)
传送门题面:Distinct ValuesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 705 Accepted Submission(s): 186Problem DescriptionChiaki has ...原创 2018-07-23 21:40:49 · 353 阅读 · 0 评论 -
2018牛客网暑假多校第一场J(树状数组+思维)
题目描述: 有一个n个数的数列,并由q个询问,每一个询问有一个l和r,问你在区间a1—al和ar—an这两个区间中有多少个不同的数。题目分析: 这个题目事实上是spoj的某一题的改编,原题是求l到r区间有多少个不同的数,现在这个题是要求两个分开的区间有多少个不同的数。 事实上这个题的做法跟求l到r区间有多少个不同的数的做法相类似。首先,因为数据范围很大,因此我们需...原创 2018-07-20 11:01:30 · 407 阅读 · 0 评论 -
2018牛客暑假多校二 D(贪心)
题目描述: 你要按照顺序以此经过n个商店,每到达一个商店你可以购买一件物品,也可以出售你手中的商品。 同一时刻你手上最多拿一件商品。在第i个商店购买和出售的代价都是a[i]。 问你经过完n个商店后的最大收益。 同时,在最大化收益的前提下,求最小的交易次数。题目分析: 不难发现,要想使得利益最大,我们肯定是要在一个单调区域中的最小值中购入,再从该单调区域的最大值时...原创 2018-07-21 21:18:48 · 228 阅读 · 0 评论 -
HDU 6435(状态压缩)
传送门题面:You are playing CSGO. There are n Main Weapons and m Secondary Weapons in CSGO. You can only choose one Main Weapon and one Secondary Weapon. For each weapon, it has a composite score S. T...原创 2018-08-23 09:11:07 · 358 阅读 · 0 评论 -
Codeforces 1029F(思维)
传送门题面:F. Multicolored Markerstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is an infinite board of square tiles. Ini...原创 2018-08-30 23:29:33 · 335 阅读 · 0 评论 -
Codeforces 1029D(数论+思维)
传送门题面:D. Concatenated Multiplestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array aa, consisting of nn p...原创 2018-08-31 16:12:23 · 831 阅读 · 0 评论 -
Codeforces 1029C(贪心)
传送门题面:C. Maximal Intersectiontime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn segments on a number line; eac...原创 2018-08-31 16:46:30 · 397 阅读 · 0 评论 -
Codeforces 1028C(面积并/思维)
传送门题面:C. Rectanglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn rectangles on a plane with coordinates o...原创 2018-08-28 22:33:29 · 528 阅读 · 0 评论 -
2018牛客网暑期ACM多校训练营(第六场)J(脑洞)
题目描述: 给你一个大小为n的数组,数组中的每一个数由A,B,C,D四个参数根据某个奇怪的代码生成,问你在这n个数中选取2两个数,使得lcm(ai,aj)最大。题目分析: 要做出这个题需要一定的脑洞。我们打表可以发现,每次答案可能是最大的数和第二大的数的lcm,或者是最大的数和第三个数的lcm,或者是第二大的数和第三大的数的lcm........我们可以发现,最终的结果必定...原创 2018-08-04 19:27:40 · 255 阅读 · 2 评论 -
ACM-ICPC 2018 徐州赛区网络预赛G (单调队列)
传送门题面:There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ) means the wave is a rectangle whose vertexes are ( 00 , 00 ), ( xx , 00 ), ( 00 , yy ), ...原创 2018-09-10 12:47:27 · 175 阅读 · 0 评论 -
Codeforces 1041D(双指针)
传送门题面:D. Glidertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA plane is flying at a constant height of hh meters above the...原创 2018-09-25 10:57:36 · 336 阅读 · 0 评论 -
BZOJ 1800(思维)
传送门题面:1800: [Ahoi2009]fly 飞行棋Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 2267 Solved: 1733[Submit][Status][Discuss]Description给出圆周上的若干个点,已知点与点之间的弧长,其值均为正整数,并依圆周顺序排列。 请找出这些点中有没有可以围成矩形的,...原创 2018-10-22 12:29:47 · 205 阅读 · 0 评论 -
Gym 101775 D (思维)
传送门:题面:D. Mr. Panda and Geometric Sequencetime limit per test3.0 smemory limit per test256 MBinputstandard inputoutputstandard outputMr. Panda likes playing with numbers. One day...原创 2018-11-06 21:40:07 · 472 阅读 · 0 评论 -
Gym 101933E(状态压缩+记忆化搜索)
传送门题面:E. Explosion Exploittime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputIn a two player card game, you have nn minions on the board a...原创 2018-11-10 15:50:08 · 545 阅读 · 2 评论 -
Codeforces 1066 C(思维)
传送门:题面:C. Books Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have got a shelf and want to put some books on it...原创 2018-11-11 23:43:04 · 271 阅读 · 0 评论 -
Codeforces 1104 E(DFS生成树)
传送门题意:给你一个有nnn个结点,mmm条边的无向连通图,以及一个数字kkk。现在问你,能否构成如下的两种情况:找到111条长度大于nk\frac{n}{k}kn路径,并把这条路径输出找到kkk个环,要求每个环的长度至少要为333,且环的长度不能被333整除。并把这kkk个环的路径都输出出来题目分析在这道题中,我们需要运用到DFS生成树的一些性质。首先,对于DFS生成树,简...原创 2019-02-03 21:09:15 · 630 阅读 · 0 评论 -
Codeforces 1003D(贪心)
传送门题面:D. Coins and Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has nn coins, the value of the ii-th coin is aiai. It is guaran...原创 2018-07-09 18:44:40 · 596 阅读 · 0 评论 -
Codeforces 988D(STL运用+思维)
传送门题面: D. Points and Powers of Twotime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn distinct points on a coordinate line, the coordi...原创 2018-06-02 15:57:13 · 499 阅读 · 0 评论 -
HDU 6294(思维)
传送门题面: SA-IS后缀数组Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 503 Accepted Submission(s): 153Problem Description小Q最近阅读了SA-IS算法在线性时间内构造...原创 2018-06-01 20:16:42 · 497 阅读 · 0 评论 -
Codeforces 977D(思维)
传送门题面:D. Divide by three, multiply by twotime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp likes to play with numbers. He takes some integer...原创 2018-05-09 13:21:38 · 905 阅读 · 0 评论 -
HDU 6025(思维)
传送门题面:Coprime SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1964 Accepted Submission(s): 926Problem Description Do you know what ...原创 2018-04-21 09:16:50 · 230 阅读 · 0 评论 -
HDU 6026(最短路)
传送门 题面:Deleting EdgesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1154 Accepted Submission(s): 407Problem Description Little Q is cra...原创 2018-04-21 09:33:05 · 340 阅读 · 0 评论 -
HDU 6029(思维)
传送门 题面:Graph TheoryTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1220 Accepted Submission(s): 553Problem Description Little Q loves pl...原创 2018-04-21 09:57:45 · 378 阅读 · 0 评论 -
Codeforces 980B(思维)
传送门题面:B. Marlintime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe city of Fishtopia can be imagined as a grid of 44 rows and an odd number of colu...原创 2018-05-09 21:43:52 · 544 阅读 · 0 评论 -
Codeforces 976E/925C (01Trie树)
传送门题面:C. Big Secrettime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVitya has learned that the answer for The Ultimate Question of Life, the Univer...原创 2018-05-03 14:19:50 · 271 阅读 · 0 评论 -
2016 pku campusD/OpenJ_POJ - C16D(规律+大数)
传送门题面:总时间限制: 1000ms内存限制: 262144kB描述As we all know, to pass PE exams, students need to do extracurricular sports, especially jogging. As the result, the Jogging Association in the university is very po...原创 2018-05-04 19:11:14 · 179 阅读 · 0 评论 -
2016 pku campus J/OpenJ_POJ - C16J (思维)
传送门描述We use the following method (presented in pseudocode) to do a traversal on a binary tree T. Each node of T has an integer value, and may have no child, one left child, one right child or both lef...原创 2018-05-04 19:37:36 · 173 阅读 · 0 评论 -
HDU 6264(思维)
传送门题面:Problem A. Super-palindromeYou are given a string that is consistedof lowercase English alphabet. You are supposed to change it into asuper-palindrome string in minimum steps. You can change one...原创 2018-04-27 19:14:50 · 469 阅读 · 0 评论 -
HDU 6266(思维+规律)
传送门 题面:Problem C. Hakase and NanoHakase and Nano are playing an ancientpebble game (pebble is a kind of rock). There are n packs ofpebbles, and the i-th pack contains ai pebbles. They take turns to...原创 2018-04-27 19:34:45 · 1125 阅读 · 0 评论 -
HDU 6273(树状数组+思维)
传送门题面:Problem J. Master of GCDHakase has n numbers ina line. At first, they are all equal to 1. Besides, Hakase is interested in primes.She will choose a continuous subsequence [l,r] and a prime param...原创 2018-04-27 20:57:52 · 604 阅读 · 0 评论 -
HDU 5510(KMP+思维)
传送门题面:BazingaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6560 Accepted Submission(s): 2003 Problem DescriptionLadies and g...原创 2018-04-29 11:55:38 · 214 阅读 · 0 评论 -
Codeforces 982D (带权并查集)
传送门题面:D. Sharktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor long time scientists study the behavior of sharks. Sharks, as many other species,...原创 2018-05-21 14:31:35 · 699 阅读 · 0 评论 -
Codeforces 985C (贪心)
传送门题面: C. Liebig's Barrelstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have m = n·k wooden staves. The i-th stave has length ai. You hav...原创 2018-05-24 14:03:52 · 926 阅读 · 0 评论 -
Codeforces 985D(二分答案)
传送门题面: D. Sand Fortresstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are going to the beach with the idea to build t...原创 2018-05-24 14:21:16 · 1096 阅读 · 2 评论 -
Codeforces 989C (构造)
传送门题面:C. A Mist of Florescencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs the boat drifts down the river, a wood full of blossoms shows up o...原创 2018-06-12 17:37:23 · 439 阅读 · 0 评论 -
Codeforces 990C (思维)
传送门题面: C. Bracket Sequences Concatenation Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA bracket sequence is a string containing only...原创 2018-06-14 14:16:20 · 326 阅读 · 0 评论 -
zoj 4130(The 16th Zhejiang Provincial Collegiate Programming Contest D)(思维)
传送门:题意:你现在有nnn个点,对于第iii个点,可以到达第i−1i-1i−1、2∗i2*i2∗i、2∗(i+1)2*(i+1)2∗(i+1)、⌊i2⌋\left \lfloor \frac{i}{2} \right \rfloor⌊2i⌋号点。现在问你从111号点开始的哈密顿路径。分析:一道非常有意思的题目。我们需要发掘题目中隐藏的信息。首先,假设该顶点不能到达第i−1i-1i−...原创 2019-04-28 21:57:03 · 235 阅读 · 0 评论