思维乱搞
文章平均质量分 84
nka_kun
ACMer
展开
-
岛屿的数量(思维+扯淡)(细节分析)
先把题目附上: 有N个岛连在一起形成了一个大的岛屿,如果海平面上升超过某些岛的高度时,则这个岛会被淹没。原本的大岛屿则会分为多个小岛屿,如果海平面一直上升,则所有岛都会被淹没在水下。给出N个岛的高度。然后有Q个查询,每个查询给出一个海平面的高度H,问当海平面高度达到H时,海上共有多少个岛屿。例如:岛屿的高度为:{2, 1, 3, 2, 3}, 查询为:{0, 1, 3, 2}。...原创 2017-06-17 12:27:44 · 442 阅读 · 0 评论 -
Educational Codeforces Round 43 Well played!
Well played!Recently Max has got himself into popular CCG "BrainStone". As "BrainStone" is a pretty intellectual game, Max has to solve numerous hard problems during the gameplay. Here is one of them:...原创 2018-05-01 18:32:55 · 383 阅读 · 0 评论 -
CodeForces - 959E Mahmoud and Ehab and the xor-MST(异或)
Mahmoud and Ehab and the xor-MSTEhab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices ...原创 2018-05-09 19:04:46 · 336 阅读 · 0 评论 -
Wannafly挑战赛15 出队(模拟思维)
题目描述 约瑟夫问题(https://baike.baidu.com/item/约瑟夫问题),n个人,1 2报数 1出队( 就是体育课的时候1 2报数 1出队,2留下),q次询问,每次求第x个人是第几个出队的输入描述:第一行两个数n,q接下来q行,每行一个数x,表示询问输出描述:一行输出一个询问的答案示例1输入4 3234输出324思路:我们发现每次都是位于奇数位置的人出队,所以对于某...原创 2018-05-12 13:29:25 · 175 阅读 · 0 评论 -
2018山东省赛E题 Sequence
SequenceTime Limit: 1000 ms Memory Limit: 65536 KBProblem DescriptionWe define an element a_iai in a sequence "good", if and only if there exists a j(1\le j < i)j(1≤j<i) such that a_j < a_ia...原创 2018-05-14 15:24:18 · 559 阅读 · 0 评论 -
2018HDU多校第一场1004 HDU6301Distinct Values
Distinct Values Time Limit: 4000/2000 MS (Java/Others)...原创 2018-07-24 13:23:39 · 124 阅读 · 0 评论 -
2018牛客多校第四场J题 Hash Function(思维+并查集)
题目描述 Chiaki has just learned hash in today's lesson. A hash function is any function that can be used to map data of arbitrary size to data of fixed size. As a beginner, Chiaki simply chooses a hash...原创 2018-07-29 14:32:30 · 623 阅读 · 1 评论 -
HDU-6319 Ascending Rating(思维)
Ascending RatingProblem DescriptionBefore the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left ...原创 2018-07-31 21:59:54 · 804 阅读 · 0 评论 -
牛客网多校(第七场) J题(好题)
题目描述 You have a n * m grid of characters, where each character is an English letter (lowercase or uppercase, which means there are a total of 52 different possible letters).A nonempty subrectangle ...原创 2018-08-10 16:16:37 · 230 阅读 · 0 评论 -
CodeForces(503) 1019A Elections(枚举)
Elections time limit 2 secondsAs you know, maj...原创 2018-08-12 12:26:26 · 273 阅读 · 0 评论 -
Codeforces Round #502 C
The Phone Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMrs. Smith is trying to contact her husband, John Smith, but she ...原创 2018-08-09 00:42:35 · 279 阅读 · 0 评论 -
Codeforces Round #502 D
The Wutime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputChildan is making up a legendary story and trying to sell his forgery — a...原创 2018-08-09 00:45:23 · 240 阅读 · 0 评论 -
HDU-6396 Swordsman
Swordsman Time Limit: 2000/1000 MS (Java/O...原创 2018-08-13 20:16:14 · 241 阅读 · 0 评论 -
HDU - 6274 Master of Sequence
There are two sequences a1, a2, · · · , an, b1, b2, · · · , bn. Let S(t) =∑⌊(t−bi)ai⌋. . There are m operationswithin three kinds as following:• 1 x y: change value ax to y.• 2 x y: change value bx...原创 2018-10-13 10:57:49 · 253 阅读 · 0 评论 -
Codeforces Round #426 (Div. 2)The Meaningless Game(思维+二分)
lastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster tha原创 2017-07-31 01:24:48 · 1083 阅读 · 0 评论 -
Codeforces Round #428 (Div. 2) Game of the Rows (思维)
Daenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to bring her army to the other side of the sea to get the Iron Throne. She has recently bought an airplane to carry her army through the sea.原创 2017-08-13 11:55:37 · 297 阅读 · 0 评论 -
第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛 C-平分游戏
链接:https://www.nowcoder.com/acm/contest/90/C来源:牛客网集训队一共有n位同学,他们都按照编号顺序坐在一个圆桌旁。第i位同学一开始有a[i]个硬币,他们希望使得每位同学手上的硬币变成相同的数目。每一秒钟,有且仅有一位同学可以把自己手上的一枚硬币交给另一位同学,其中这两位同学中间必须间隔k位同学。现在问的是最少几秒后所有同学手上的有相同数量的硬币输入描述:第...原创 2018-03-27 16:12:59 · 175 阅读 · 0 评论 -
UVA - 11987 Almost Union-Find (并查集可删除)(两种方法)
Almost Union-FindTime Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem AAlmost Union-FindI hope y原创 2017-07-22 14:41:30 · 390 阅读 · 0 评论 -
HDU 6016 Count the Sheep(思维题)(Interesting)
Count the Sheep Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)原创 2017-07-22 16:29:17 · 336 阅读 · 0 评论 -
HDU6112 2017"百度之星"程序设计大赛 - 初赛(A) 今夕何夕(年份模拟)
今夕何夕Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 981 Accepted Submission(s): 330Problem Description今天是2017年8月6日,农历闰六月十五。原创 2017-08-12 21:51:54 · 414 阅读 · 1 评论 -
Codeforces Round #432 (Div. 2)B题 (等弦对等弧)
Arpa is taking a geometry exam. Here is the last problem of the exam.You are given three points a, b, c.Find a point and an angle such that if we rotate the page around the point by the angle, the new position of a is the same as the old position of b,原创 2017-09-07 16:59:42 · 362 阅读 · 0 评论 -
51NOD 1875丢手绢 (思维+打表)
六一儿童节到了,小朋友们在玩丢手绢的游戏。总共有C个小朋友,编号从1到C,他们站成一个圈,第i(1<i<=C)个人的左边是i-1,第1个人的左边是C。第i(1<=i<C)个人的右边是i+1,第C个人的右边是1。然后再给出一个常数E。刚开始的时候1号小朋友拿着手绢,接下来游戏开始,在游戏的每一轮,拿手绢的人会把手绢向右边传递E-1个人,拿到手绢的人退出圈,把手绢递给他右边的小朋友,剩下的人向中间挨紧,把圈中的空位补满。然后开始下一轮,如此往复。直到圈中只剩一个人。比如C=6,E=5的时候,出圈的顺序是5,4,原创 2017-09-12 16:03:21 · 532 阅读 · 0 评论 -
Bear and Blocks CF-574D(类似dp+思维)
Bear and Blockstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is原创 2017-11-06 21:30:47 · 314 阅读 · 0 评论 -
CF#446 Gluttony(思维题)
Gluttonytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a with n distinct integers. Construct an array b by permuting a such that for every non-empty subset of indices S = {x原创 2017-11-18 17:21:52 · 1035 阅读 · 0 评论 -
CF#446 Pride(水暴力)
Pridetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, an原创 2017-11-18 19:20:20 · 945 阅读 · 0 评论 -
CF#119 Permutations(思维)
Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHappy PMP is freshman and he is learning about algorithmic problems. He enjoys playing algorithmic games a lot.One of the seniors gave原创 2017-11-24 19:04:32 · 260 阅读 · 0 评论 -
CodeForces - 931D Peculiar apple-tree(思维)
Peculiar apple-treeIn Arcady's garden there grows a peculiar apple-tree that fruits one time per year. Its peculiarity can be explained in following way: there are n inflorescences, numbered from 1 to...原创 2018-03-09 12:31:48 · 285 阅读 · 0 评论 -
CodeForces - 618D Hamiltonian Spanning Tree(思维)
Hamiltonian Spanning TreeA group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in total. It takes exactly y seconds to tr...原创 2018-03-30 14:31:45 · 332 阅读 · 0 评论 -
2018省赛第九届蓝桥杯真题C语言B组第十题题解 乘积最大
2018第九届蓝桥杯C++省赛B组[最新题解汇总]标题:乘积最大给定N个整数A1, A2, ... AN。请你从中选出K个数,使其乘积最大。 请你求出最大的乘积,由于乘积可能超出整型范围,你只需输出乘积除以1000000009的余数。 注意,如果X<0, 我们定义X除以1000000009的余数是负(-X)除以1000000009的余数。即:0-((0-x) % 1000000009)【...原创 2018-04-02 14:42:27 · 3906 阅读 · 0 评论 -
CodeForces960DFull Binary Tree Queries(二叉树的操作)
Full Binary Tree QueriesYou have a full binary tree having infinite levels.Each node has an initial value. If a node has value x, then its left child has value 2·x and its right child has value 2·x + ...原创 2018-04-14 22:30:29 · 557 阅读 · 0 评论 -
2019第十届蓝桥杯B组决赛题解第八题
题意:外圈12个,中圈8个,内圈4个,'R','B','Y'分别有12个,8个,4个,分布在这个24个位置上,每次可以把三个圈同时旋转一个单位,可以在0位置把三者做交换,外->内->中->外,问能否把'R'都弄到外,'B'都弄到中,'Y'都弄到内找规律题目?对所有数对4取余,红黄蓝都应该是0,1,2,3代码待更...原创 2019-05-27 17:14:51 · 1868 阅读 · 0 评论