CF
H_On
这个作者很懒,什么都没留下…
展开
-
【Codeforces Global Round 7】C. Permutation Partitions 题解
题目链接:C. Permutation Partitions题目题意给你 n 个数,把这些数分成 k 组,每组里的最大值相加必须最大,也就是说:找到这 n 个树中最大的 k 个数,这些数必须各自存在于单独的一组解题思路这道题其实就是高中学 Cnm 的那种排列组合的分组问题,简单来说就是插卡插一张卡,分成两份,插两张卡,分成三份。。。而这道题更简单,分组的间隔已经明确告诉你了,你...原创 2020-03-21 17:59:07 · 198 阅读 · 0 评论 -
【Codeforces Global Round 7】B. Maximums 题解
题目链接:B. Maximums题目题意已知数组 b 和条件 bi = ai - max(0, a0, a1, ..., a(i-1))求数组 a解题思路这道题是一道【反向贪心】,听别人说的这个名词= =实际上就是第一个数你可以确定一定是 0 ,之后每一个数都可以由前面已经获得的数来确定。而贪心就是“走一步看一步”,每次操作获得“当前看起来是最优的解”,所以当作贪心也没什么问题...原创 2020-03-21 17:58:01 · 237 阅读 · 0 评论 -
【Codeforces Global Round 7】A. Bad Ugly Numbers 题解
题目链接:A. Bad Ugly Numbers题目题意给你一个数字 n ,输出一个数字 s ,s 满足一些要求s 的位数等于 n ,即 s 由 n 个数字组成s 这个数不能被其中的任何一位整除解题思路如果是一位数的话,它当然可以被自己整除,所以直接输出 -1如果是多位数找一个特殊的数即可,如 233 或者 277代码#include <iostream>...原创 2020-03-21 17:56:32 · 248 阅读 · 0 评论 -
【Codeforces Round#619 (Div. 2)】B. Motarack's Birthday 题解
题目链接:B. Motarack’s Birthday题目题意给你 n 个数,其中有一些可能被替换成了 -1 。现在让你用一个数 k 替换所有的 -1 ,使两个相邻的数 差的绝对值的最大值 m 最小。输出 k 和 m 的值。解题思路这个题主要是需要处理 -1 与旁边 不是 -1 的数 的关系。连续的 -1 替换以后相邻差值是 0 不用管连续的非 -1 数邻差直接在遍历的时候记...原创 2020-02-21 22:04:08 · 264 阅读 · 0 评论 -
【Codeforces Round#621 (Div. 1 + Div. 2)】D. Cow and Fields 题解
题目链接:D. Cow and Fields题目一直觉得英文题题面很难理解,然后也有题目链接,很纠结要不要每次都把题目再写一遍,昨天看大佬题解是贴一个截图上去,感觉也不错,以后我就这么干辣题意给你 n 个点,t 条边,k 个特殊点。问你如何给这个图加一条连结两个特殊点的边,使新图点 1 到点 n 的 最短路最长。问你最长的最短路的值。(好绕啊)解题思路参考这位大佬的题解先储...原创 2020-02-19 20:45:48 · 300 阅读 · 0 评论 -
【Codeforces Round#621 (Div. 1 + Div. 2)】C. Cow and Message 题解
题目链接:C. Cow and Message题目一直觉得英文题题面很难理解,然后也有题目链接,很纠结要不要每次都把题目再写一遍,昨天看大佬题解是贴一个截图上去,感觉也不错,以后我就这么干辣题意有一个字符串,里面有很多子序列,组成子序列的字母在字符串中的位置组成一个 等差数列 ,这些子序列可能有好多种组成方式,问你在所有的子序列的组成方式的个数中的最大值是多少。解题思路害,一开始没...原创 2020-02-19 20:41:37 · 241 阅读 · 0 评论 -
【Codeforces Round#621 (Div. 1 + Div. 2)】B. Cow and Friend 题解
题目链接:B. Cow and Friend题目一直觉得英文题题面很难理解,然后也有题目链接,很纠结要不要每次都把题目再写一遍,昨天看大佬题解是贴一个截图上去,感觉也不错,以后我就这么干辣[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sNBIL0Hd-1582115945269)(/images/20200219/B1.png)][外链图片转存失败,源站可能...原创 2020-02-19 20:39:52 · 178 阅读 · 0 评论 -
【Codeforces Round#621 (Div. 1 + Div. 2)】A. Cow and Haybales 题解
题目链接:A. Cow and Haybales题目一直觉得英文题题面很难理解,然后也有题目链接,很纠结要不要每次都把题目再写一遍,昨天看大佬题解是贴一个截图上去,感觉也不错,以后我就这么干辣[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bMHMT6GX-1582115841010)(/images/20200219/A.png)]题意有 n 个按顺序放好...原创 2020-02-19 20:38:47 · 209 阅读 · 0 评论 -
【Codeforces Round#620 (Div. 2)】C. Air Conditioner 题解
题目链接:C. Air Conditioner题目Gildong owns a bulgogi restaurant. The restaurant has a lot of customers, so many of them like to make a reservation before visiting it.Gildong tries so hard to satisfy the...原创 2020-02-17 06:51:02 · 218 阅读 · 0 评论 -
【Codeforces Round#620 (Div. 2)】B. Longest Palindrome 题解
题目链接:B. Longest Palindrome题目Returning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its reverse. For example, strin...原创 2020-02-17 06:50:48 · 250 阅读 · 0 评论 -
【Codeforces Round#620 (Div. 2)】A. Two Rabbits 题解
题目链接:A. Two Rabbits题目Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. On...原创 2020-02-17 06:50:05 · 321 阅读 · 0 评论 -
【Codeforces Round#593 (Div. 2)】A. Stones 题解
题目链接:A. Stones题目Alice is playing with some stones.Now there are three numbered heaps of stones. The first of them contains a stones, the second of them contains b stones and the third of them conta...原创 2020-02-17 06:48:31 · 269 阅读 · 0 评论 -
【Codeforces Round#587 (Div. 3)】D. Swords 题解
题目链接:D. Swords题目There were n types of swords in the theater basement which had been used during the plays. Moreover there were exactly x swords of each type. y people have broken into the theater ba...原创 2020-02-17 06:47:25 · 346 阅读 · 0 评论 -
【Codeforces Round#618 (Div. 2)】C. Anu Has a Function 题解
题目链接:C. Anu Has a Function题目Anu has created her own function f: f(x,y)=(x|y)−y where | denotes the bitwise OR operation. For example, f(11,6)=(11|6)−6=15−6=9. It can be proved that for any nonnegati...原创 2020-02-17 06:46:03 · 145 阅读 · 0 评论 -
【Codeforces Round#618 (Div. 2)】B. Assigning to Classes 题解
题目链接:B. Assigning to Classes题目Reminder: the median of the array [a1,a2,…,a2k+1] of odd number of elements is defined as follows: let [b1,b2,…,b2k+1] be the elements of the array in the sorted order....原创 2020-02-17 06:45:43 · 240 阅读 · 0 评论 -
【Codeforces Round#618 (Div. 2)】A. Non-zero 题解
题目链接:A. Non-zero题目Guy-Manuel and Thomas have an array a of n integers [a1,a2,…,an]. In one step they can add 1 to any element of the array. Formally, in one step they can choose any integer index i ...原创 2020-02-17 06:43:41 · 167 阅读 · 0 评论 -
【寒假CodeForces】D. Fight with Monsters 题解
欢迎收藏个人博客:【寒假CodeForces】D. Fight with Monsters 题解题目链接:D. Fight with Monsters题目There are n monsters standing in a row numbered from 1 to n. The i-th monster has hi health points (hp). You have your a...原创 2020-02-06 14:18:57 · 522 阅读 · 0 评论 -
【寒假CodeForces】C. Yet Another Walking Robot 题解【奇妙的记录方式
欢迎收藏个人博客:【寒假CodeForces】C. Yet Another Walking Robot 题解【奇妙的记录方式题目链接:C. Yet Another Walking Robot题目There is a robot on a coordinate plane. Initially, the robot is located at the point (0,0). Its path...原创 2020-02-06 14:17:12 · 669 阅读 · 0 评论 -
【寒假CodeForces】B. Food Buying 题解
欢迎收藏个人博客:【寒假CodeForces】B. Food Buying 题解题目链接:B. Food Buying题目Mishka wants to buy some food in the nearby shop. Initially, he has s burles on his card.Mishka can perform the following operation any...原创 2020-02-06 14:14:18 · 289 阅读 · 0 评论 -
【寒假CodeForces】A. Array with Odd Sum 题解
原文地址题目链接:A. Array with Odd Sum题目You are given an array a consisting of n integers.In one move, you can choose two indices 1≤i,j≤n such that i≠j and set ai:=aj. You can perform such moves any numbe...原创 2020-02-06 14:11:37 · 443 阅读 · 0 评论