- 博客(11)
- 收藏
- 关注
原创 2017年河北省大学生程序设计竞赛 奇异旅馆 【并查集+树状数组】
2017年河北省大学生程序设计竞赛 奇异旅馆 【并查集+树状数组】玩了一天,小A又带着他的小伙伴们来到了当地的奇异旅馆。这个旅馆共有n层,每层分别有ai个床位。由于没有电梯,大家都希望尽可能住在较低的楼层。现在小A提出了q个操作,操作分为两种:1.从第xi层开始向上安置numi个小伙伴住宿。2.询问前ki层一共已经安置的小伙伴数目。假设一开始每层楼的床位都是未被使用的,且若操作1中xi层及以上的房间无法容纳所要安置的人,则尽可能多地安置,剩余部分忽略。
2017-11-25 21:30:54 813
原创 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 1059
原创 Codeforces 893E - Counting Arrays 【组合数】
Codeforces 893E - Counting Arrays 【组合数】 You are given two positive integer numbers x and y. An array F is called an y-factorization of x iff the following conditions are met:· There are y elements in F, and all of them are integer numbers; · . You
2017-11-24 15:00:09 1037
原创 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 480
原创 Codeforces 591E - Three States 【BFS】
Codeforces 591E - Three States 【BFS】 The famous global economic crisis is approaching rapidly, so thestates of Berman, Berance and Bertaly formed an alliance and allowed theresidents of all member states to freely pass through the territory of any ofthem.
2017-11-22 00:45:10 360
原创 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 557
原创 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 731
原创 HDU 6237/2017CCPC哈尔滨 A Simple Stone Game【质因子】
HDU 6237/2017CCPC哈尔滨 A Simple Stone Game【质因子】After he has learned how toplay Nim game, Bob begins to try another stone game which seems much easier.The game goes like this: one player starts the game with N piles of stones. There is ai stoneson the i th
2017-11-12 23:46:57 2134
原创 Codeforces 888D - Almost Identity Permutations 【数学模拟】
Codeforces 888D - Almost Identity Permutations 【数学模拟】A permutation p of size n is an array such that every integer from 1 to n occurs exactly once in this array.Let's call a permutation an almost identity permutation iff there exist at least n - k indice
2017-11-10 00:59:41 1052
原创 HDU 6228/2017ACM/ICPC 沈阳 Tree 【DFS】
HDU 6228/2017ACM/ICPC 沈阳 Tree 【DFS】Consider a un-rooted tree T which is not the biological significance of tree or plant,but a tree as an undirected graph in graph theory with n nodes, labelled from 1to n. If you cannot understand the concept of a tree he
2017-11-05 13:30:59 2294
原创 Codeforces 887C - Solution for Cube 【魔方旋转】
Codeforces 887C - Solution for Cube 【魔方旋转】During the breaks between competitions, top-model Izabella triesto develop herself and not to be bored. For example, now she tries to solveRubik's cube 2x2x2.It's too hard to learn to solve Rubik's cube instantly
2017-11-04 11:28:59 1178 7
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人