oj
Df_cjc
这个作者很懒,什么都没留下…
展开
-
SDNU——8题——A - Division 优美暴力
今天终于算是把双十一那天的作业完成了——优美的暴力枚举——贪心算法——数字的排列组合问题 有些算法题哪些绝妙的地方我还真是想不出来,但是在一点一点吃着大佬们的营养代码的时候,我还真的是颇有收获,起码是对某一种算法或者思想有了一些基本的认识和思考~ 今天就来总结一下这8道题。 先看第一道 A - Division Write a program that finds and原创 2017-11-13 19:51:04 · 467 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——D - The Suspects
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s原创 2017-12-01 16:10:35 · 205 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——E - Ubiquitous Religions
There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university beli原创 2017-12-01 16:17:02 · 197 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——G - How Many Tables
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a原创 2017-12-01 18:34:28 · 221 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——H - 种类并查集(选做)
TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT shou原创 2017-12-01 18:46:49 · 223 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——I - Supermarket
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the s原创 2017-12-01 19:09:16 · 219 阅读 · 0 评论 -
SDNU-DFS——F - Pet
One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in the room but didn’t find the hamster. He tried to use some cheese to trap the hamster. He put the cheese tr原创 2017-12-01 14:03:24 · 257 阅读 · 0 评论 -
sdnu-并查集-weeklyexam —— A - 畅通工程
某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对原创 2017-12-01 14:53:22 · 232 阅读 · 0 评论 -
sdnu-并查集-weeklyexam —— B - Pseudo-Random Numbers
Computers normally cannot generate really random numbers, but frequently are used to generate sequences of pseudo-random numbers. These are generated by some algorithm, but appear for all practical pu原创 2017-12-01 15:22:18 · 229 阅读 · 0 评论 -
sdnu-并查集&图论-weeklyexam ——C - Play on Words
Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impo原创 2017-12-01 16:02:32 · 277 阅读 · 0 评论 -
时针分针角度问题1094.Clock
1094.Clock Time Limit: 1000 MS Memory Limit: 32768 KB Total Submission(s): 90 Accepted Submission(s): 35 Description There is an analog clock with two hands: an hour han原创 2017-11-22 13:08:44 · 519 阅读 · 0 评论 -
SDNU-BFS——E - The Social Network
The social network system (SNS) helps people to keep connecting with their friends. Every user in SNS has a friends list. The user can read news posted by the users in his friends list. Friend relatio原创 2017-11-30 21:29:09 · 287 阅读 · 0 评论 -
SDNU-BFS——D - A strange lift
There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if you p原创 2017-11-30 21:00:38 · 202 阅读 · 0 评论 -
SDNU——8题——C - Maximum Product
Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive terms of S. If you cannot find a positive sequence,原创 2017-11-13 20:35:32 · 313 阅读 · 0 评论 -
SDNU——8题——D - Yogurt factory
The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that it will cost the co原创 2017-11-13 21:06:14 · 290 阅读 · 0 评论 -
SDNU——8题——B - Fractions Again?!
It is easy to see that for every fraction in the form 1 k (k > 0), we can always find two positive integers x and y, x ≥ y, such that: 1/k=1/x+1/y Now our question is: can you write a program tha原创 2017-11-13 20:08:39 · 325 阅读 · 0 评论 -
SDNU——8题——E - To the Max
Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of原创 2017-11-13 21:25:19 · 291 阅读 · 0 评论 -
SDNU——8题——G - The Useless Toy
Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she ha原创 2017-11-29 16:31:52 · 247 阅读 · 0 评论 -
SDNU——8题—— H - A Mathematical Curiosity
Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer. This problem contains multiple test cases! The first line原创 2017-11-29 16:45:53 · 318 阅读 · 0 评论 -
SDNU-DFS——A - 变形课
呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体. Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(ball)变成一个M(Mouse),你知道,原创 2017-11-29 17:08:52 · 321 阅读 · 0 评论 -
SDNU-DFS——B - Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th原创 2017-11-30 16:53:21 · 286 阅读 · 0 评论 -
SDNU-DFS——C - Red and Black
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can'原创 2017-11-30 18:41:02 · 233 阅读 · 0 评论 -
sdnu-并查集-weeklyexam ——F - 带权并查集(选做)
动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地原创 2017-12-01 16:31:43 · 279 阅读 · 0 评论