D - Secret Santa 有 \(n\) 个人,第 \(i\) 个人想给第 \(a_i\) 个人送礼物. 每个人都要恰好收到 1 份礼物 ,每个人不能给自己送东西. 令第 \(i\) 个人最终把礼物送给了 \(b_i\) . 求一种安排人送礼物的方法使得 \(b_i=a_i\) 的数量最多. ...
转载
2021-07-18 19:22:00
129阅读
2评论
只要统计一下给的数字中最大的那一位十位数就是所求答案 #include <bits/stdc++.h> using namespace std; void solve(){ int n; cin >> n; int maxn = -1; while(n){ maxn = max(maxn, n % ...
转载
2021-07-20 00:44:00
57阅读
2评论
733.图像渲染题解 后续的操作类似,使用递归算法,深度优先搜索。注意要保留原有颜色来递归。class Solution { in
原创
2022-11-07 14:39:31
34阅读
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to
原创
2022-08-03 17:00:24
28阅读
An image is represented by a 2 D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr,
转载
2018-11-01 13:49:00
57阅读
2评论
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr,
转载
2020-05-12 06:05:00
47阅读
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。 给你一个坐标 (sr, sc) 表示图像渲染开始的像素值(行 ,列)和一个新的颜色值 newColor,让你重新上色这幅图像。 为了完成上色工作,从初始坐标开始,记录初始坐标的上下左右四个方向上像素
转载
2020-11-10 23:28:00
61阅读
2评论
题目描述有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。给
原创
2022-07-12 17:36:32
135阅读
原题链接在这里:https://leetcode.com/problems/flood-fill/ 题目: An image is represented by a 2-D array of integers, each integer representing the pixel value of
转载
2019-12-18 10:59:00
97阅读
2评论
题目链接:传送门 给你n行,每行有个li,和ri 美丽值是|l-r| 分别是l和r的总和 要求交换一行的r和l值,使得美丽值最
原创
2022-07-15 11:31:38
20阅读
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr,
转载
2020-04-17 02:44:00
85阅读
2评论
At first it is look as similar is island, which is use DFS to solve, and truly the solution in leetcode is use this idea. But I think here
原创
2023-08-23 09:22:55
47阅读
733. 图像渲染四个方向上符合条件的像素点与他们对应四个方向上像素值与初始坐标相同的相连像素点,……,重复该过程。将所有有记录的像素点的颜色值改为新的颜色值。
最后返
原创
2023-01-31 14:34:24
36阅读
1. 题目描述【DFS】图像渲染2. 题目分析题目给你了一个二维的地图,给你一个出发点的坐标,基本很明确
原创
2023-05-24 14:52:07
51阅读
题目描述:
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。四个方...
原创
2022-11-01 10:54:40
39阅读
B. Parade time limit per test1 second memory limit per test256 megabytes inputstand
原创
2022-10-18 13:37:48
59阅读
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the starting pixel (row and column
原创
2023-05-30 17:13:52
38阅读
【题目链接】:http://codeforces.com/problemset/problem/733/F【题意】 给你n个点m条边; 让你从中选出n-1条边; 形成一个生成树; (即让n个点都联通); 然后,你有S的预算; 每次可以选择一条边i,然后花费ci的预算,把这条边的权值...
转载
2017-10-04 18:44:00
42阅读
2评论
class Solution { public int[][] floodFill(int[][] image, int sr, int sc, int newColor) { int [][]foot = new int[image.length][image[0].length]; delete
原创
2022-06-01 09:17:12
73阅读
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。给你一个坐标 (sr, sc) 表示图像渲染开始的像素值(行 ,列)和一个新的颜色值 newColor,让你重新上色这幅图像。为了完成上色工作,从初始坐标开始,记录初始坐标的上下左右四个方向上像素值与初始坐标相同的相连像素点,接着再记录这四个方向上符合条件的像素点与他们对应四个方向上像素值与初始坐标相同的相连像素点,……,重复该过程。将所有有记录的像素点的颜色值改为新的颜色值
原创
2021-08-10 10:13:00
159阅读