
思维脑洞
Dust_Heart
这个作者很懒,什么都没留下…
展开
-
牛客练习赛59 石子搬运【优先队列+思维】
石子搬运Time Limit: 1000 MS Memory Limit: 262144K Problem Description链接:https://ac.nowcoder.com/acm/contest/4743/E来源:牛客网有n堆石子,第i堆石子的石子数量是ai,作为牛客网的一头领头牛,牛牛决定把这些石子搬回牛客。如果牛牛一次搬运的石子数量是k,那么这堆石子将对牛牛产生k2...原创 2020-03-13 22:06:26 · 967 阅读 · 0 评论 -
Codeforces 230E - Triangles 【图论】
Codeforces 230E - Triangles 【图论】 Alice and Bob don't play games anymore. Now they studyproperties of all sorts of graphs together. Alice invented the following task:she takes a complete undirected graph with n vertices, chooses some m edges and keeps the原创 2017-11-22 23:43:22 · 508 阅读 · 0 评论 -
Codeforces 894C - Marco and GCD Sequence 【GCD+思维】
Codeforces 894C - Marco and GCD Sequence 【GCD+思维】 In a dream Marcomet an elderly man with a pair of black glasses. The man told him the key toimmortality and then disappeared with the wind of time.When he woke up,he only remembered that the key was a se原创 2017-11-20 00:44:48 · 584 阅读 · 0 评论 -
HDU 6242/2017CCPC哈尔滨 Geometry Problem 【随机化+计算几何】
HDU 6242/2017CCPC哈尔滨 Geometry Problem 【随机化+计算几何】Alice is interesting in computation geometry problem recently. She found ainteresting problem and solved it easily. Now she will give this problem to you:You are given N distinctpoints (Xi,Yi) on thetwo-d原创 2017-11-13 22:38:22 · 760 阅读 · 0 评论 -
HDU 6172 Array Challenge 【线性递推式模板】
HDU 6172 Array Challenge 【线性递推式模板】Problem DescriptionThere’s an array that isgenerated by following rule.h0=2,h1=3,h2=6,hn=4hn−1+17hn−2−12hn−3−16 And let us define two arrays bn and an asbelow.bn=3hn+1hn+9hn+1hn−1+9h2n+27hnhn−1−18hn+1−126hn−81hn−1+192原创 2017-10-25 20:36:30 · 642 阅读 · 0 评论 -
UESTC 1690 这是一道比CCCC简单题难的简单题||HiHoCoder #1048 : 状态压缩·二
UESTC 1690 这是一道比CCCC简单题难的简单题||HiHoCoder #1048 : 状态压缩·二给定一个n*m的矩阵,使用1*2的小长方形覆盖矩阵,要求完全覆盖的同时不出现重合,也不允许超出边界,问有多少种可能的覆盖方法,方案数对1e9+7取模历经千辛万苦,小Hi和小Ho终于到达了举办美食节的城市!虽然人山人海,但小Hi和小Ho仍然抑制不住兴奋之情,他们放下行李便投入到了美食节的活动当中。美食节的各个摊位上各自有着非常多的有意思的小游戏,其中一个便是这样子的:小Hi和小Ho领到了一个大小为原创 2017-07-06 22:06:57 · 1099 阅读 · 0 评论 -
Atcoder Tenka1 Programmer Beginner Contest IntegerotS 【异或+思维】
Atcoder Tenka1 Programmer Beginner Contest IntegerotS 【异或+思维】Seisu-ya, a store specializing in non-negative integers, sellsN non-negative integers. The i-th integer isAi and has a utility ofBi. There may be multiple equal integers with different utilit原创 2017-10-01 10:21:36 · 400 阅读 · 0 评论 -
HDU 5534 Partial Tree 【完全背包+思维】
HDU 5534 Partial Tree 【完全背包+思维】2015ACM/ICPC亚洲区长春站-重现赛(感谢东北师大) Inmathematics, and more specifically in graph theory, a tree is an undirectedgraph in which any two nodes are connected by exactly one path. In other words,any connected graph without simple c原创 2017-09-12 23:16:23 · 572 阅读 · 1 评论 -
2017年河北省大学生程序设计竞赛 奇妙糖果屋 【二进制+异或】
2017年河北省大学生程序设计竞赛 奇妙糖果屋 【二进制+异或】奇异王国里有很多奇怪的事物。比如奇怪的人(每个人都拥有一个智慧值),奇怪的商店......这不,奇异糖果屋今天开业了,老板在门口拉上了“糖果送送送”的横幅来吸引顾客。糖果的具体赠送方案为对于一个智慧值为x的人来说,他所能获得的糖果数量f(x)满足如下条件:1.f(0)= 0,2.f(2x) =f(x),3.f(2x+1) =f(2x) +1,整天搞怪的小A带着朋友们闻讯而来,他想出了一个游戏,游戏的规则是这样的:每个人根据原创 2017-11-25 21:26:20 · 1108 阅读 · 0 评论 -
Codeforces 898E - Squares and not squares 【优先队列贪心】
Codeforces 898E - Squares and not squares 【优先队列贪心】 Ann and Boryahave n piles with candies and n is even number. There are ai candies in pile with number i.Ann likesnumbers which are square of some integer and Borya doesn't like numbers whichare square o原创 2017-12-17 00:32:13 · 1027 阅读 · 0 评论 -
Codeforces 899D - Shovel Sale 【思维】
Codeforces 899D - Shovel Sale 【思维】There are n shovels in Polycarp's shop. The i-th shovel costs i burles, thatis, the first shovel costs 1 burle, thesecond shovel costs 2 burles, the thirdshovel costs 3 burles, and so on.Polycarps wants to sell shovels in原创 2017-12-17 16:50:22 · 1096 阅读 · 0 评论 -
Codeforces 934C - A Twisty Movement 【前缀和+思维】
C. A Twisty Movementtime limit per test 1 secondmemory limit per test 256 megabytes A dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day,people model a dragon with...原创 2018-02-15 00:01:36 · 1507 阅读 · 4 评论 -
Codeforces 932D - Tree 【树上倍增】
Codeforces 932D - Tree 【树上倍增】You are given a node of the tree withindex 1 and with weight 0. Let cnt be the numberof nodes in the tree at any instant (initially, cnt is set to 1). Support Q queries offollowing two types:Add a new node (index cnt + 1) wi原创 2018-02-20 00:04:09 · 1124 阅读 · 2 评论 -
Codeforces 950C - Zebras 【思维】
Codeforces 950C - Zebras 【思维】Codeforces Round #469 (Div. 2)Oleg writes down the history of the days he lived. For each day he decides if it was good orbad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day原创 2018-03-09 20:18:21 · 1787 阅读 · 1 评论 -
Codeforces 914C - Travelling Salesman and Special Numbers 【思维】
Codeforces 914C - Travelling Salesman and Special Numbers 【思维】Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined)memory limit per test 256 megabytesThe Travelling Salesman spends a lot of time travelling so he tends to get bored. To原创 2018-03-16 16:13:50 · 850 阅读 · 0 评论 -
Codeforces 960C - Subsequence Counting 【思维+构造】
Codeforces 960C - Subsequence Counting 【思维+构造】Divide by Zero 2018 and Codeforces Round #474 (Div. 1 + Div. 2, combined)Pikachu had an array with him. He wrotedown all the non-empty subsequences of the array on paper. Note that an arrayof size n has 2n -原创 2018-04-08 10:29:56 · 1024 阅读 · 0 评论 -
Codeforces 957D - Riverside Curio 【思维】
Codeforces 957D - Riverside Curio 【思维】codeforces Round #472 (rated, Div. 2, based on VK Cup 2018 Round 2)Arkady decides to observe a river for n consecutivedays. The river's water level on each day is equal to some real value.Arkady goes to the riversid原创 2018-03-26 20:35:29 · 608 阅读 · 0 评论 -
Codeforces 967E - Big Secret 【DFS序+线段树】
Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3)Vitya has learned that the answer forThe Ultimate Question of Life, the Universe, and Everything is not the integer 5442, but an increasing integer sequence a1,…,an In order to not reveal原创 2018-04-30 22:30:08 · 799 阅读 · 2 评论 -
2017 ACM-ICPC 西安赛区 网络赛 F. Trig Function 【规律题】
2017 ACM-ICPC 西安赛区 网络赛 F. Trig Function 【规律题】 Problem Descriptionf(cos(x))=cos(n∗x) holds for all x.Given two integersn and m , you need to calculate the coefficient of x^m in f(x), modulo 998244353InputMultiple testcases (no more than 100).Each te原创 2017-09-16 19:14:39 · 1463 阅读 · 0 评论 -
CF Round #422( Div.1/2) D. My pretty girl Noora
CF Round #422( Div.1/2) D. My pretty girl NooraIn Pavlopolis University where Noora studies it was decided tohold beauty contest "Miss Pavlopolis University". Let's describe theprocess of choosing the most beautiful girl in the university in more detail.原创 2017-07-03 03:11:41 · 560 阅读 · 0 评论 -
Educational Codeforces Round 24 (B Permutation Game,D. Multicolored Cars)
Educational Codeforces Round 24 (B Permutation Game,D. Multicolored Cars)n children are standing in a circle andplaying a game. Children's numbers in clockwise order form a permutationa1, a2, ..., an of length n. It is an integer sequence such thateach i原创 2017-06-30 11:18:28 · 944 阅读 · 3 评论 -
CF Round #418( Div.2) An impassioned circulation of affection
CF Round #418( Div.2) An impassioned circulation of affectionNadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!原创 2017-06-08 01:15:24 · 647 阅读 · 0 评论 -
CF Round #412( Div.2) Success Rate
C. Success Ratetime limit per test 2 secondsmemory limit per test256 megabytesYou are an experienced Codeforces user.Today you found out that during your activity on Codeforces you hav原创 2017-05-08 01:41:10 · 431 阅读 · 0 评论 -
ZOJ 3954 Seven-Segment Display
InputOutputSample InputSample OutputHintSeven-Segment DisplayTime Limit: 1 Second Memory Limit: 65536 KB A seven segment display, or seven segment indicator, is a form of elect原创 2017-05-06 00:30:46 · 310 阅读 · 0 评论 -
CF Round #411 (Div. 2) Minimum number of steps
D. Minimum number of stepstime limit per test1 secondmemory limit per test256 megabytesWe have a string of letters 'a' and 'b'. We want toperform some operations on it. On each ste原创 2017-05-05 16:28:51 · 559 阅读 · 0 评论 -
HDOJ 5100 Chessboard (骨牌覆盖问题)
ChessboardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1170 Accepted Submission(s): 500Problem DescriptionConsider the probl原创 2017-04-05 20:28:25 · 376 阅读 · 0 评论 -
HDOJ 5063 Operation the Sequence (优化后的暴力)
Operation the SequenceTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1000 Accepted Submission(s): 341Problem DescriptionYou ha原创 2017-04-04 18:00:49 · 298 阅读 · 0 评论 -
CF Round #423 Div. 2 C. String Reconstruction D. High Load 【思维】
CF Round #423 Div. 2 C. String Reconstruction D. High Load 【思维】Ivan had string s consisting of small English letters.However, his friend Julia decided to make fun of him and hid the string s. Ivan preferred making a new string tofinding the old one.原创 2017-07-13 00:22:09 · 980 阅读 · 0 评论 -
2017 Multi-University Training Contest 7 && HDU 6121 Build a tree 【思维】
2017 Multi-University Training Contest 7 && HDU 6121 Build a tree 【思维】Problem DescriptionHazelFan wants to build a rooted tree. The tree hasn nodes labeled 0 ton−1, and the father of the node labeledi is the node labeled ⌊(i−1)/k⌋. HazelFan wonders the s原创 2017-08-15 21:28:08 · 863 阅读 · 0 评论 -
2017 Multi-University Training Contest 5 &&HDU 6085 Rikka with Candies 【bitset+思维】
HDU 6085 Rikka with Candies 【bitset】As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:There are nchildren and mkinds of candies. The ith child has Aidol原创 2017-08-09 17:01:25 · 426 阅读 · 0 评论 -
HDOJ 5920 Ugly Problem 【模拟】
HDOJ 5920 Ugly Problem 【模拟】Everyone hates ugly problems.You are given a positive integer. You must represent that number by sum of palindromic numbers.A palindromic number is a positive integer such that if you write out that integer as a string in de原创 2017-07-26 21:05:42 · 348 阅读 · 0 评论 -
Codeforces 835C - Star sky 【预处理前缀和】
Codeforces 835C - Star sky 【DP+前缀和】 The Cartesian coordinate system is set in the sky. There you cansee n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initialbrightness si (0 ≤ si ≤ c).Over time the stars原创 2017-08-01 01:43:13 · 2539 阅读 · 0 评论 -
2017 Multi-University Training Contest 3 && HDOJ 6058 Kanade's sum 【链表模拟】
2017 Multi-University Training Contest 3 && HDOJ 6058 Kanade's sum 【链表模拟】 Give you an array A[1..n]of length n. Let f(l,r,k)be the k-th largest element of A[l..r].Specially , f(l,r,k)=0if r−l+1<k.Give you k, you need to calculate ∑n原创 2017-08-01 23:45:58 · 513 阅读 · 0 评论 -
CF Round #424( Div.2) C. Jury Marks 【思维+STL】
CF Round #424( Div.2) C. Jury Marks 【思维+STL】Polycarp watched TV-show where k jury members one by one rated aparticipant by adding him a certain number of points (may be negative,i. e. points were subtracted). Initially the participant had some score,and原创 2017-07-14 01:58:06 · 1259 阅读 · 0 评论