暑假练习
npuyan
这个作者很懒,什么都没留下…
展开
-
二、stl ,模拟,贪心等 [Cloned] D - stl 的 map
原题:Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby highway bridge which he can use to escape from his enemies. Hi...原创 2018-08-02 23:21:55 · 153 阅读 · 0 评论 -
一、热身 [Cloned] N - Bullseye
原题:A simple dartboard consists of a flat, circular piece of cork with concentric rings drawn on it. Darts are thrown at the board by players in an attempt to hit the center of the dartboard (the Bul...原创 2018-08-01 19:26:29 · 148 阅读 · 0 评论 -
一、热身 [Cloned] M - 枚举答案能不能做?
原题:The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains...原创 2018-08-01 19:21:04 · 123 阅读 · 0 评论 -
一、热身 [Cloned] L - Delta-wave
原题:A triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to the cell with number N. The traveller ...原创 2018-08-01 19:14:21 · 115 阅读 · 0 评论 -
一、热身 [Cloned] K - next_permutation
原题:Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero first. feng5166 says, ...原创 2018-08-01 19:06:05 · 150 阅读 · 0 评论 -
一、热身 [Cloned] J - Ignatius and the Princess IV
原题:"OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among them, you have ...原创 2018-07-31 21:02:27 · 160 阅读 · 0 评论 -
一、热身 [Cloned] I - 辗转相除法求最大公约数
原题:The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105. 题意:...原创 2018-07-31 20:53:41 · 133 阅读 · 0 评论 -
一、热身 [Cloned] H - 请使用sort
原题:Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is indeed a mission-im...原创 2018-07-31 18:55:38 · 153 阅读 · 0 评论 -
一、热身 [Cloned] G - 请使用sort
原题:Football is one of the greatest games in the world. Lots of people like to play football. After one season of matches, the header has to calculate the last scores of every team. He is too lazy that...原创 2018-07-31 18:46:38 · 207 阅读 · 0 评论 -
一、热身 [Cloned] F - Robot Motion
原题: A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (u...原创 2018-07-31 18:37:26 · 122 阅读 · 0 评论 -
一、热身 [Cloned] E - A + B
原题:读入两个小于100的正整数A和B,计算A+B. 需要注意的是:A和B的每一位数字由对应的英文单词给出. 题意:.......就是英文输入数字计算和题解:这题,没啥好解的啊就是字符串输入输入一直到加号然后输入输入一直到等号因为给出的是英文数字而且没有位数所以要转化一下然后计算输出就行了到两个0的时候停止代码:AC#include<i...原创 2018-07-31 18:30:07 · 186 阅读 · 0 评论 -
一、热身 [Cloned] D - 不容易系列之(3)―― LELE的RPG难题
原题:人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题: 有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.求全部的满足要求的涂法. 以上就是...原创 2018-07-31 18:25:32 · 134 阅读 · 0 评论 -
一、热身 [Cloned] C - Edge
原题:For products that are wrapped in small packings it is necessary that the sheet of paper containing the directions for use is folded until its size becomes small enough. We assume that a sheet of ...原创 2018-07-31 18:14:16 · 143 阅读 · 0 评论 -
一、热身 [Cloned] B - Candy Sharing Game
原题:A number of students sit in a circle facing their teacher in the center. Each student initially has an even number of pieces of candy. When the teacher blows a whistle, each student simultaneousl...原创 2018-07-31 18:00:38 · 152 阅读 · 0 评论 -
一、热身 [Cloned] O - Dirichlet's Theorem on Arithmetic Progressions
原题:If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime number...原创 2018-08-01 19:32:10 · 176 阅读 · 0 评论 -
一、热身 [Cloned] P - Reduced ID Numbers
原题:T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN = 10 6-...翻译 2018-08-01 19:40:53 · 145 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] G - stl 的 优先队列
原题:In a speech contest, when a contestant finishes his speech, the judges will then grade his performance. The staff remove the highest grade and the lowest grade and compute the average of the rest...原创 2018-08-02 23:15:13 · 133 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] F - 递推
原题:我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 题意:一条折线可以将平面分成两部分,两条折线可以分成七部分,问n条折线可以分成几部分题解:显然这是递推的问题,当添加第n条折线的时候,已经有n-1条折线存在,添加最多产生4*(n-1)个交点...原创 2018-08-02 23:01:37 · 114 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] E - 贪心
原题:FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J[i] pounds ...原创 2018-08-02 22:55:19 · 138 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] C - stl 的 map
原题:夏天来了~~好开心啊,呵呵,好多好多水果~~ Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了. 题意:给出几组数据,包括水果的名称、产地、销售数量,对这些数据进行统计,统计分类包括如下几层,首先是相同产地的各类水果,分别列出,然后相同产地的相同水果的销售数量要加和在一起。...原创 2018-08-02 22:49:22 · 131 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] B - stl 的 map
原题:Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius ...原创 2018-08-02 22:42:17 · 163 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] A - stl 的 map
原题:Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they wil...原创 2018-08-02 22:37:06 · 145 阅读 · 0 评论 -
一、热身 [Cloned] Z - A + B Problem II
原题:I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. 题意:输入两个大数求和。题解:就是大数加和的问题,用字符串储存,然后相当于竖式加法,注意进位和输出格式的问题就ok了代码:AC#include&l...原创 2018-08-02 22:32:43 · 139 阅读 · 0 评论 -
一、热身 [Cloned] Y - A == B ?
原题:Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".题意:给出两个数,比较这两个数是否相等题解:开始真没搞明白到底啥意思......其实就是要把小数点之后的多余的零去掉然后比较一下两个字符串是否相等,如果有小数点就先找到小数点的位置,然后将数字最后的多余...原创 2018-08-02 22:30:28 · 118 阅读 · 0 评论 -
一、热身 [Cloned] X - Specialized Four-Digit Numbers
原题:Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and...原创 2018-08-02 22:24:08 · 155 阅读 · 0 评论 -
一、热身 [Cloned] W - The Circumference of the Circle
原题:To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't? You are given the cartesian coordinates of three non-collinear point...翻译 2018-08-01 20:12:35 · 122 阅读 · 0 评论 -
一、热身 [Cloned] U - Long Distance Racing
原题:Bessie is training for her next race by running on a path that includes hills so that she will be prepared for any terrain. She has planned a straight path and wants to run as far as she can -- b...原创 2018-08-01 20:06:10 · 183 阅读 · 0 评论 -
一、热身 [Cloned] R - Joseph
原题:The Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle every mth is going to be exec...原创 2018-08-01 20:01:08 · 105 阅读 · 0 评论 -
一、热身 [Cloned] Q - 高精度(大数)n次方
原题:Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer sys...原创 2018-08-01 19:49:05 · 221 阅读 · 0 评论 -
一、热身 A题
第一个题 因为之前不知道还要写题解 只做了题 所以现在回来补题解八十个......争取尽快补完.....题意:如果一个数n不等于1,那么如果它是奇数就n=3n+1,是偶数就n=n/2,一直到n等于1,一共需要sum步才能实现,给出两个数,要找出两个数之间sum最大的数。题解:就穷举吧.......把两个数之间所有的数的sum都算出来比较,求最大的输出代码#include&...原创 2018-07-31 17:49:28 · 390 阅读 · 0 评论 -
三、搜索和二分 [Cloned] S - 搜索
原题:定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。题意:中文...原创 2018-08-05 09:40:06 · 183 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] Y - 栈
原题:How can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT: [ i i i i o o o o i o i i o o i o ] where i stands for ...原创 2018-08-04 18:30:11 · 136 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] X - 栈
原题:As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all o...原创 2018-08-04 18:09:37 · 141 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] W - stl 的 优先队列
原题:Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this time...原创 2018-08-04 18:04:29 · 184 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] U - 贪心
原题:A set of n 1-dimensional items have to be packed in identical bins. All bins have exactly the same length l and each item i has length li<=l . We look for a minimal number of bins q such that ...原创 2018-08-04 17:54:22 · 165 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] T - 贪心
原题: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 ...原创 2018-08-03 23:34:50 · 154 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] S - 贪心
原题: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 ...原创 2018-08-03 23:27:14 · 160 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] R - 贪心
原题:Today the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty level yi. The machine whose level below this task’s level yi cannot comp...原创 2018-08-03 23:23:30 · 225 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] Q - 贪心
原题:When playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN. There are two key attribut...原创 2018-08-03 23:17:25 · 217 阅读 · 0 评论 -
二、stl ,模拟,贪心等 [Cloned] P - 贪心
原题:Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework aft...原创 2018-08-03 23:09:54 · 134 阅读 · 0 评论