02 2021 档案

摘要:Description - 题目描述 给定若干位十进制数,你可以通过选择一个非空子集并以某种顺序构建一个数。剩余元素可以用相同规则构建第二个数。除非构造的数恰好为0,否则不能以0打头。举例来说,给定数字0,1,2,4,6与7,你可以写出10和2467。当然写法多样:210和764,204和176,等 阅读全文
posted @ 2021-02-28 18:33 mikku 阅读(55) 评论(0) 推荐(0)
摘要:Problem Description In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, . 2 7 3 8 . . 1 . . 1 . 阅读全文
posted @ 2021-02-27 20:45 mikku 阅读(71) 评论(0) 推荐(0)
摘要:题目链接 DLX例题(洛谷模板题就是省选难度了qwq)。 DLX的具体思想我就不赘述了,网上有很多讲的不错的。下附链接 网站1,网站2,网站3,网站4 AC代码如下(代码思路就看注释吧……) #include<iostream> #include<cstdio> #include<cstring> 阅读全文
posted @ 2021-02-26 20:24 mikku 阅读(80) 评论(0) 推荐(0)
摘要:Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cell 阅读全文
posted @ 2021-02-25 20:28 mikku 阅读(65) 评论(0) 推荐(0)
摘要:Problem Description 在李老板众多的农场中,有这样一片N*M大小的田地,它在下雨后积起了水。在他的田地中,'W'代表积水,'.'代表土地,一片相互连接的积水叫做“水WA”。(每个格子被认为和相邻的8个格子相连)现在农场工作人员传回来了田地的航拍图,余队长让你帮他确定有多少个“水WA 阅读全文
posted @ 2021-02-25 17:03 mikku 阅读(57) 评论(0) 推荐(0)
摘要:Problem Description 火火某天AK太多了心烦,想带领小伙伴们做游戏 。游戏内容如下:当火火喊出一个数字n时,便有n个小伙伴,身上带着1到n的数字,手牵手拉成一个环。当环里的每个人相邻两人身上数字之和都为素数时,便找到了一个环。当找出所有的环时,游戏便结束。Note: 每个环的第一个 阅读全文
posted @ 2021-02-25 16:09 mikku 阅读(67) 评论(0) 推荐(0)
摘要:Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There a 阅读全文
posted @ 2021-02-24 20:04 mikku 阅读(61) 评论(0) 推荐(0)
摘要:Problem Description Harbin, whose name was originally a Manchu word meaning "a place for drying fishing nets", grew from a small rural settlement on t 阅读全文
posted @ 2021-02-23 20:24 mikku 阅读(51) 评论(0) 推荐(0)
摘要:本代码模板提供了高精度加法,减法。高精乘高精,高精乘低精,高精除低精,高精除高精。且都已函数封装的形式给出。(思路就是列竖式。加减乘都从最低位开始。除从最高位开始) #include<cstdio> #include<algorithm> #include<vector> #include<cstr 阅读全文
posted @ 2021-02-22 19:36 mikku 阅读(333) 评论(0) 推荐(0)
摘要:题目链接 这题有多组输入。 高精度用列竖式的方法做即可。 可以用2个字符串来得到A,B,再逆序赋值到2个整形数组当中。 最后再用一个整形数组来保存结果(当然也可以保存在之前那2个整形数组中的一个) 我写的时候遇到了一个困难,顺便涨了涨知识(敲黑板) 数组被作为参数传递时会退化为指针,如果用sizeo 阅读全文
posted @ 2021-02-21 19:25 mikku 阅读(61) 评论(0) 推荐(0)
摘要:题目链接 这是一道终极经典的树形DP的例题。 树形dp就是将DP的数据放到了一棵树上。每个父节点与其子节点的值有关。推出如何建树和递推公式即可。 f[i][j].(j=1/0)i表示这是谁,j为1时表示来,0时表示不来。这个式子表示i来或不来时的最大快乐值。 设k为他的下属。 则f[i][1]+=f 阅读全文
posted @ 2021-02-20 19:21 mikku 阅读(52) 评论(0) 推荐(0)
摘要:题目链接 本题是区间DP。即维护区间内的最大操作价值。 f[i][j]=max(f[i][j],f[i][k]+f[k][j]).f[i][j]为第i个数到第j个数区间内的最大操作价值。 对每个区间附初值abs(a[j]-a[i])*(j-i+1)即可。 #include<cstdio> #incl 阅读全文
posted @ 2021-02-20 18:37 mikku 阅读(80) 评论(0) 推荐(0)
摘要:题目链接 这题的思路是动态规划。 找到每个数以该数为结尾的最长上升子序列长度和以该数为开始的最长下降子序列的长度。 其中求以该数为开始的最长下降子序列的长度可以看做从最后一个数开始往前数,以该数为结尾的最长上升子序列的长度。 求最长上升子序列长度。令f[j]=max(f[j],f[k]+1).(k< 阅读全文
posted @ 2021-02-20 17:10 mikku 阅读(63) 评论(0) 推荐(0)
摘要:题目链接 这题是完全背包问题。背包容量变成了最后的平方和。装进背包的物品为各个平方数。且可以取无限个。 dp[i][j]+=dp[i−k∗k][j−1]。i为平方和。j为由几个数组成的这个平方和。 最后答案为j=1~4的和。 (又是一道看了题解才会的题) #include<cstdio> #incl 阅读全文
posted @ 2021-02-19 20:17 mikku 阅读(63) 评论(0) 推荐(0)
摘要:题目链接 依旧是01背包问题。(也可以看成是多重背包问题。但反之多重背包问题也是化作01背包来解) 对于到第i朵花,摆j朵花的f[i][j]=f【i-1】【j-a[i]】+f【i-1】【j-a【i】+1】+…+f【i-1】【j-1】。 (dp真的是看一题题解会一题,做一题不会一题nnd) #incl 阅读全文
posted @ 2021-02-19 19:53 mikku 阅读(45) 评论(0) 推荐(0)
摘要:题目链接 这是一道dp题。 传到一个人手上的情况数等于上一轮传到左边的人的情况数加上传到右边的人的情况数。 即f【i】【j】=f【i-1】【j-1】+f【i+1】【j+1】. 注意一下环的边界。 #include<cstdio> #include<algorithm> #include<cstrin 阅读全文
posted @ 2021-02-19 19:46 mikku 阅读(169) 评论(0) 推荐(0)
摘要:题目链接 01背包问题。 详见背包九讲。 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; int c,h,w[5005],dp[50005]; int 阅读全文
posted @ 2021-02-19 17:50 mikku 阅读(31) 评论(0) 推荐(0)
摘要:题目链接 本题就是完全背包。直接套用模板即可。 关于完全背包的讲解可以去看背包九讲。 注意开long long。 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long 阅读全文
posted @ 2021-02-19 17:39 mikku 阅读(52) 评论(0) 推荐(0)
摘要:exgcd 模板题1(更基础) 模板题 裴蜀定理 夜深人静写算法-初等数论入门 背包九讲.pdf 夜深人静写算法-动态规划入门 阅读全文
posted @ 2021-02-18 14:40 mikku 阅读(30) 评论(0) 推荐(0)
摘要:Problem Description Bruce Force has had an interesting idea how to encode strings. The following is the description of how the encoding is done:Let x1 阅读全文
posted @ 2021-02-17 20:54 mikku 阅读(67) 评论(0) 推荐(0)
摘要:In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the quest 阅读全文
posted @ 2021-02-17 19:23 mikku 阅读(56) 评论(0) 推荐(0)
摘要:Problem Description 考虑一个含有 N 个细胞的一维细胞自动机。细胞从 0 到 N-1 标号。每个细胞有一个被表示成一个小于 M 的非负 整数的状态。细胞的状态会在每个整数时刻发生骤变。我们定义 S(i,t) 表示第 i 个细胞在时刻 t 的状态。在 时刻 t+1 的状态被表示为 阅读全文
posted @ 2021-02-17 18:04 mikku 阅读(46) 评论(0) 推荐(0)
摘要:Problem Description Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak. Input The input contains exactly one test 阅读全文
posted @ 2021-02-17 15:06 mikku 阅读(47) 评论(0) 推荐(0)
摘要:In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are: 阅读全文
posted @ 2021-02-16 20:17 mikku 阅读(48) 评论(0) 推荐(0)
摘要:Problem Description Kolya loves putting gnomes at the circle table and giving them coins, and Tanya loves studying triplets of gnomes, sitting in the 阅读全文
posted @ 2021-02-16 18:26 mikku 阅读(60) 评论(0) 推荐(0)
摘要:Problem Description You are given a sequence of n integers a1, a2, ..., an. Determine a real number x such that the weakness of the sequence a1 - x, a 阅读全文
posted @ 2021-02-16 16:48 mikku 阅读(61) 评论(0) 推荐(0)
摘要:Problem Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at position 阅读全文
posted @ 2021-02-15 20:04 mikku 阅读(60) 评论(0) 推荐(0)
摘要:Problem Description You are going to the beach with the idea to build the greatest sand castle ever in your head! The beach is not as three-dimensiona 阅读全文
posted @ 2021-02-14 20:17 mikku 阅读(65) 评论(0) 推荐(0)
摘要:Problem Description Bizon the Champion isn't just charming, he also is very smart. While some of us were learning the multiplication table, Bizon the 阅读全文
posted @ 2021-02-13 21:30 mikku 阅读(61) 评论(0) 推荐(0)
摘要:Problem Description Josephina is a clever girl and addicted to Machine Learning recently. Shepays much attention to a method called Linear Discriminan 阅读全文
posted @ 2021-02-13 20:30 mikku 阅读(79) 评论(0) 推荐(0)
摘要:Problem Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expan 阅读全文
posted @ 2021-02-13 18:57 mikku 阅读(77) 评论(0) 推荐(0)
摘要:Problem Description Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to form a non-dege 阅读全文
posted @ 2021-02-12 17:31 mikku 阅读(69) 评论(0) 推荐(0)
摘要:Problem Description Due to the increase in the number of students of Berland State University it was decided to equip a new computer room. You were gi 阅读全文
posted @ 2021-02-12 17:16 mikku 阅读(76) 评论(0) 推荐(0)
摘要:Problem Description Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he went to Professor Zulu's Lab. Si 阅读全文
posted @ 2021-02-11 20:05 mikku 阅读(54) 评论(0) 推荐(0)
摘要:Problem Description One spring day on his way to university Lesha found an array A. Lesha likes to split arrays into several parts. This time Lesha de 阅读全文
posted @ 2021-02-10 20:23 mikku 阅读(48) 评论(0) 推荐(0)
摘要:Problem Description Think of New York as a rectangular grid consisting of N vertical avenues numerated from 1 to N and M horizontal streets numerated  阅读全文
posted @ 2021-02-09 19:25 mikku 阅读(82) 评论(0) 推荐(0)
摘要:Problem Description There are n employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important question and the leading 阅读全文
posted @ 2021-02-09 18:27 mikku 阅读(57) 评论(0) 推荐(0)
摘要:Problem Description Long time ago Alex created an interesting problem about parallelogram. The input data for this problem contained four integer poin 阅读全文
posted @ 2021-02-09 16:15 mikku 阅读(112) 评论(0) 推荐(0)
摘要:Problem Description Bachgold problem is very easy to formulate. Given a positive integer n represent it as a sum of maximum possible number of prime n 阅读全文
posted @ 2021-02-09 15:26 mikku 阅读(87) 评论(0) 推荐(0)
摘要:Problem Description 小明最近宅在家里无聊,于是他发明了一种有趣的游戏,游戏道具是N张叠在一起的卡片,每张卡片上都有一个数字,数字的范围是0~9,游戏规则如下: 首先取最上方的卡片放到桌子上,然后每次取最上方的卡片,放到桌子上已有卡片序列的最右边或者最左边。当N张卡片全部都放到桌子 阅读全文
posted @ 2021-02-08 17:46 mikku 阅读(78) 评论(0) 推荐(0)
摘要:Problem Description “今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些 阅读全文
posted @ 2021-02-08 16:42 mikku 阅读(50) 评论(0) 推荐(0)
摘要:Problem Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floo 阅读全文
posted @ 2021-02-08 16:01 mikku 阅读(65) 评论(0) 推荐(0)
摘要:Problem Description For decades, scientists have wondered whether each of the numbers from 0 to 100 could be represented as the sum of three cubes, wh 阅读全文
posted @ 2021-02-07 19:46 mikku 阅读(237) 评论(0) 推荐(0)
摘要:Problem Description A remote island chain contains n islands, labeled 1 through n. Bidirectional bridges connect the islands to form a simple cycle — 阅读全文
posted @ 2021-02-07 17:41 mikku 阅读(64) 评论(0) 推荐(0)
摘要:Problem Description Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at 阅读全文
posted @ 2021-02-06 19:21 mikku 阅读(63) 评论(0) 推荐(0)
摘要:Problem Description Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, c 阅读全文
posted @ 2021-02-06 18:27 mikku 阅读(73) 评论(0) 推荐(0)
摘要:Problem Description Little Ruins is a studious boy, recently he learned the four operations!Now he want to use four operations to generate a number, h 阅读全文
posted @ 2021-02-06 17:24 mikku 阅读(80) 评论(0) 推荐(0)
摘要:Problem Description Little John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessa 阅读全文
posted @ 2021-02-05 21:39 mikku 阅读(139) 评论(0) 推荐(0)
摘要:Problem Description NPY is learning arithmetic progression in his math class. In mathematics, an arithmetic progression (AP) is a sequence of numbers 阅读全文
posted @ 2021-02-05 21:00 mikku 阅读(103) 评论(0) 推荐(0)
摘要:UVA的judge好慢……20min还是in judege queue。 这题的首先将字符串分割为以0隔开的子串(千万不要把0放进去啊)。 对于每一个子串,将其分为3个部分。 第一个负数及之前的数的乘积(ltemp),第一个和最后一个负数中间的数的乘积(ctemp),最后一个负数及之后数的乘积(rt 阅读全文
posted @ 2021-02-05 19:18 mikku 阅读(54) 评论(0) 推荐(0)
摘要:Problem Description Bob programmed a robot to navigate through a 2d maze. The maze has some obstacles. Empty cells are denoted by the character '.', w 阅读全文
posted @ 2021-02-05 17:15 mikku 阅读(79) 评论(0) 推荐(0)
摘要:Problem Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their de 阅读全文
posted @ 2021-02-04 21:45 mikku 阅读(64) 评论(0) 推荐(0)
摘要:Problem Description The "Gold Bar"bank received information from reliable sources that in their last group of N coins exactly one coin is false and di 阅读全文
posted @ 2021-02-04 20:19 mikku 阅读(66) 评论(0) 推荐(0)
摘要:Problem Description You are given two strings a and b consisting of lowercase English letters, both of length n. The characters of both strings have i 阅读全文
posted @ 2021-02-04 19:28 mikku 阅读(75) 评论(0) 推荐(0)
摘要:Problem Description Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data 阅读全文
posted @ 2021-02-04 16:57 mikku 阅读(55) 评论(0) 推荐(0)
摘要:Problem Description The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforc 阅读全文
posted @ 2021-02-03 22:11 mikku 阅读(84) 评论(0) 推荐(0)
摘要:Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal 阅读全文
posted @ 2021-02-03 21:12 mikku 阅读(88) 评论(0) 推荐(0)
摘要:Problem Description A flowerbed has many flowers and two fountains.You can adjust the water pressure and set any values r1(r1 ≥ 0) and r2(r2 ≥ 0), giv 阅读全文
posted @ 2021-02-03 19:39 mikku 阅读(92) 评论(0) 推荐(0)
摘要:Problem Description Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its a 阅读全文
posted @ 2021-02-03 17:34 mikku 阅读(150) 评论(0) 推荐(0)
摘要:Problem Description N soldiers of the land Gridland are randomly scattered around the country.A position in Gridland is given by a pair (x,y) of integ 阅读全文
posted @ 2021-02-02 20:19 mikku 阅读(84) 评论(0) 推荐(0)
摘要:Problem Description CRB has two strings s and t.In each step, CRB can select arbitrary character c of s and insert any character d (d ≠ c) just after 阅读全文
posted @ 2021-02-02 19:12 mikku 阅读(75) 评论(0) 推荐(0)
摘要:Problem Description Chiaki has 3n points p1,p2,…,p3n. It is guaranteed that no three points are collinear.Chiaki would like to construct nn disjoint t 阅读全文
posted @ 2021-02-02 16:10 mikku 阅读(65) 评论(0) 推荐(0)
摘要:Problem Description There are many people's name and birth in a list.Your task is to print the name from young to old.(There is no pair of two has the 阅读全文
posted @ 2021-02-02 15:22 mikku 阅读(86) 评论(0) 推荐(0)
摘要:Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西更长的字符串,也由小写字母组成,如果能通过魔法转换使小明的串和小西的变成同一个,那么他们两个人都会很开心。这里魔法指的是小明的串可以任意删掉某个字符,或者把某些字符 阅读全文
posted @ 2021-02-02 14:32 mikku 阅读(164) 评论(0) 推荐(0)
摘要:Problem Description 今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考生,并将他们的成绩按降序打印。 Input 测试输入包含若干场考试的信息。每场考试信息的第 阅读全文
posted @ 2021-02-02 13:24 mikku 阅读(101) 评论(0) 推荐(0)