自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 『杭电1565』方格取数(1)

Problem Description 给你一个n*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input 包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负...

2020-08-31 06:57:17 24 0

原创 『杭电1564』Play a game

Problem Description New Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game with 8600. The size of the chessboard is ...

2020-08-31 06:55:00 36 0

原创 『杭电1563』Find your present!

Problem Description In the new year party, everybody will get a "special present".Now it's your turn to get your special present, a ...

2020-08-31 06:52:28 27 0

原创 『杭电1562』Guess the number

Problem Description Happy new year to everybody! Now, I want you to guess a minimum number x betwwn 1000 and 9999 to let (1) x % a = 0; (2) (x+1) %...

2020-08-31 06:49:19 18 0

原创 『杭电1561』The more, The Better

Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽...

2020-08-31 06:47:09 12 0

原创 题841. 钥匙和房间

C++ class Solution { public: void DFS(int r,vector<vector<int>>& rooms,vector<int>& vis){ for(int i=0;i<ro...

2020-08-31 06:44:05 80 0

原创 『杭电1560』DNA sequence

Problem Description The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases f...

2020-08-30 06:57:39 21 0

原创 『杭电1559』最大子矩阵

Problem Description 给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。 Input 输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0<m,n<1000 AND 0&l...

2020-08-30 06:55:21 17 0

原创 『杭电1558』Segment set

Problem Description A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segmen...

2020-08-30 06:53:00 25 0

原创 『杭电1557』权利指数

Problem Description 在选举问题中,总共有n个小团体,每个小团体拥有一定数量的选票数。如果其中m个小团体的票数和超过总票数的一半,则此组合为“获胜联盟”。n个团体可形成若干个获胜联盟。一个小团体要成为一个“关键加入者”的条件是:在其所在的获胜联盟中,如果缺少了这个小团体的加入...

2020-08-30 06:50:28 21 0

原创 『杭电1556』Color the ball

Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色...

2020-08-30 06:48:08 17 0

原创 题557. 反转字符串中的单词 III

Python3 class Solution(object): def reverseWords(self, s): """ :type s: str :rtype: str 输入: &quo...

2020-08-30 06:45:24 19 0

原创 『杭电1555』How many days?

Problem Description 8600的手机每天消费1元,每消费K元就可以获赠1元,一开始8600有M元,问最多可以用多少天? Input 输入包括多个测试实例.每个测试实例包括2个整数M, k,(2 <= k <= M <= 1000).M = 0, k ...

2020-08-29 20:43:29 19 0

原创 『杭电1554』Pairs of integers

Problem Description You are to find all pairs of integers such that their sum is equal to the given integer number N and the second number results ...

2020-08-29 20:41:27 31 0

原创 『杭电1553』Library

Problem Description Castaway Robinson Crusoe is living alone on a remote island. One day a ship carrying a royal library has wrecked nearby. Usuall...

2020-08-29 20:39:20 19 0

原创 『杭电1551』Cable master

Problem Description Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and ha...

2020-08-29 20:35:44 16 0

原创 题214. 最短回文串

Java class Solution { public String shortestPalindrome(String s) { int n=s.length(); String str=s+"#"+new StringBuild...

2020-08-29 20:23:17 29 0

原创 题657. 机器人能否返回原点

C++ class Solution { public: bool judgeCircle(string moves) { unordered_map<char, int> mp; for(char move : moves) { mp[move]++; ...

2020-08-28 19:22:11 40 0

原创 『杭电1548』A strange lift

Problem Description 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...

2020-08-28 19:18:07 17 0

原创 『杭电1547』Bubble Shooter

Problem Description Bubble shooter is a popular game. You can find a lot of versions from the Internet. The goal of this game is to clean the bubbl...

2020-08-28 19:16:26 24 0

原创 『杭电1546』Idiomatic Phrases Game

Problem Description Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning....

2020-08-28 19:12:27 14 0

原创 『杭电1545』01-K Code

Problem Description Consider a code string S of N symbols, each symbol can only be 0 or 1. In any consecutive substring of S, the number of 0'...

2020-08-27 09:58:23 60 0

原创 『杭电1544』Palindromes

Problem Description A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCD...

2020-08-27 09:54:22 23 0

原创 『杭电1543』Paint the Wall

Problem Description Here comes our future artist. See, he is painting again, this time on home's white wall, using different color of paint. L...

2020-08-27 09:51:30 44 0

原创 『杭电1542』Atlantis

Problem Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include...

2020-08-27 09:46:50 34 0

原创 『杭电1541』Stars

Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. L...

2020-08-27 09:42:40 23 0

原创 题332. 重新安排行程

C++ class Solution { public: vector<string>re; void dfs(vector<string> &temp, map<string, map<string, int> > ...

2020-08-27 09:33:53 52 0

原创 『杭电1540』Tunnel Warfare

Problem Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. ...

2020-08-26 21:54:13 28 0

原创 『杭电1539』Shredding Company

Problem Description You have just been put in charge of developing a new shredder for the Shredding Company. Although a "normal" shredder...

2020-08-26 21:49:01 25 0

原创 『杭电1538』A Puzzle for Pirates

Problem Description A bunch of pirates have gotten their hands on a hoard of gold pieces and wish to divide the loot. They are democratic pirates i...

2020-08-26 21:45:46 20 0

原创 『杭电1537』Rubik‘s Cube

Problem Description Rummaging through the stuff of your childhood you find an old toy which you identify as the famous Rubik's Cube. While pla...

2020-08-26 21:39:55 47 0

原创 『杭电1536』S-Nim

Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows: The starting posi...

2020-08-26 20:46:10 35 0

原创 题17. 电话号码的字母组合

C++ class Solution { public: vector<string> letterCombinations(string digits) { vector<string> ret; if(d...

2020-08-26 20:40:58 32 0

原创 题491. 递增子序列

Java class Solution { public List<List<Integer>> findSubsequences(int[] nums) { List<List<Integer>> result = ne...

2020-08-25 09:26:45 31 0

原创 『杭电1535』Invitation Cards

Problem Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact....

2020-08-25 09:08:38 24 0

原创 『杭电1534』Schedule Problem

Problem Description A project can be divided into several parts. Each part should be completed continuously. This means if a part should take 3 day...

2020-08-25 09:06:26 35 0

原创 『杭电1533』Going Home

Problem Description On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizonta...

2020-08-25 09:02:52 16 0

原创 『杭电1532』Drainage Ditches

Problem Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the cl...

2020-08-25 08:58:54 27 0

原创 『杭电1531』King

Problem Description Once, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if o...

2020-08-25 08:54:15 17 0

原创 题459. 重复的子字符串

Java class Solution { public boolean repeatedSubstringPattern(String s) { // 判断鲁棒性 if (s == null || s.length() <= 1) { ...

2020-08-24 00:44:42 19 0

提示
确定要删除当前文章?
取消 删除