ICode9

精准搜索请尝试: 精确搜索
  • 洛谷 P1879 [USACO06NOV]玉米田Corn Fields2020-01-29 19:03:17

    题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't

  • 【Leetcode】279.perfect-squares2020-01-21 16:53:51

    题目地址 https://leetcode.com/problems/perfect-squares/ 题目大意 给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 解题思路 动态规划思想,dp[i]表示i的问题解, 对i开方,得到最大的平方根maxRoot, 则i的某

  • LaunchPad2020-01-19 21:02:29

    链接:https://ac.nowcoder.com/acm/contest/3665/D来源:牛客网 Hery is a boy with strong practical abilities. Nowadays,he designed a LaunchPad which is not same as what you ever seen. The LaunchPad is a touch screen divided into squares of N rows and M columns. Eac

  • [Luogu2730] 魔板 Magic Squares2020-01-01 18:00:58

    Description 在魔方风靡全球之后,RUBIK先生发明了它的简化版——魔板 如上表所示,魔板由8个同样大小的方块组成,每个方块的颜色均不相同,本题中分别用数字1-8表示,它们可能出现在魔板的任一位置。任一时刻魔板的状态都可以用方块的颜色序列表示:从魔板的左上角开始,按顺时针方向依次写下

  • codeforces #332 div 2 D. Spongebob and Squares2019-12-13 23:56:28

    http://codeforces.com/contest/599/problem/D 题意:给出总的方格数x,问有多少种不同尺寸的矩形满足题意,输出方案数和长宽(3,5和5,3算两种) 思路:比赛的时候gg了。。其实稍微在纸上推一下。就会得到对于n,m的矩形,一共会有-n*n*n+3*n*n*m+n+3*n*m的方格。数量级是n3。 我们可以实际跑一

  • 初识matplotlib2019-12-09 14:50:40

    import matplotlib.pyplot as plt#首先导入了模块pyplot,并指定别名plt,以免反复输入pyplot#模块pyplot包含很多用于生成图表的函数'''数据可视化指的是通过可视化表示来探索数据,他与数据挖掘紧密相关,而数据挖掘指的是使用代码来探索数据集的规律和关联最流行的工具matplotlib,它是

  • wssking Python 笔记 :20 matplotlib 绘制图表2019-10-07 15:00:25

    Matplotlib 是一个非常优秀的 Python 2D 绘图库,只要给出符合格式的数据,通过 Matplotlib 就可以方便地制作折线图、柱状图、散点图等各种高质量的数据图。 安装: Matplotlib 包与安装其他 Python 包没有区别,同样可以使用 pip 来安装。   CMD --> pip install matplotlib 测试:是否

  • 2019.8.30 玉米田2019-08-31 15:57:37

    题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't

  • python-matplotlib折线图2019-08-22 22:01:55

    import matplotlib.pyplot as pltimport matplotlib as mpl#下面的两行是解决中文乱码的问题,sans-serif就是无衬线字体,是一种通用字体族mpl.rcParams['font.sans-serif']=['SimHei']#指定默认字体是SimHei为黑体mpl.rcParams['axes.unicode_minus']=False#用来显示负号input_value

  • CodeForces-721A-One-dimensional Japanese Crossword2019-08-19 22:57:18

    链接: https://vjudge.net/problem/CodeForces-721A 题意: Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a × b squares, and each square is colored white or black. There are integers to the left o

  • [动态规划] leetcode 279 Perfect Squares2019-08-10 14:03:07

    problem:https://leetcode.com/problems/perfect-squares         数字类dp。查找当前数字减去一个平方数对应的最小拆分次数。 class Solution {public: int numSquares(int n) { vector<int> dp(n + 1, INT_MAX); dp[0] = 0; for(int i = 1;

  • 【广搜】魔板2019-07-19 20:51:32

    题目描述 Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. This is a sheet composed of 8 equal-sized squares: In this task we consider the version where each square has a different color. Colors are denoted

  • Squares of a Sorted Array2019-07-19 13:56:04

    Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.  Example 1: Input: [-4,-1,0,3,10]Output: [0,1,9,16,100] Example 2: Input: [-7,-3,2,3,11]Output: [4,9,9,49,12

  • Corn fields(玉米田)状压dp入门第一题 洛谷P1879 poj32542019-07-17 20:01:48

    题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't b

  • 279 - Perfect Squares2019-07-17 10:03:28

    Problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4. Example 2: Input: n = 13 Output: 2 Explanation: 13 = 4 +

  • HDU Corn Fields2019-06-26 12:51:08

    Problem Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are inferti

  • [python]List Comprehensions / 列表生成式 列表推导式2019-06-06 17:40:26

    https://docs.python.org/zh-cn/3/tutorial/datastructures.html   列表推导式提供了一个更简单的创建列表的方法。常见的用法是把某种操作应用于序列或可迭代对象的每个元素上,然后使用其结果来创建列表,或者通过满足某些特定条件元素来创建子序列。 例如,假设我们想创建一个平方列

  • Python基础(五)——闭包与lambda的结合2019-05-19 15:42:00

    (1)变量的域   要了解闭包需要先了解变量的域,也就是变量在哪一段“上下文”是有效的(类似局部变量和全局变量的区别),举一个很简单的例子。(例子不重要,就是涉及闭包就要时刻关注这个域) 1 def test():2 msg2 = 'test中的'3 print('====',msg1) # ==== 非test中的4 msg1 = '非te

  • LeetCode 279. 完全平方数(Perfect Squares)2019-05-10 22:48:36

    279. 完全平方数 279. Perfect Squares 每日一算法2019/5/10Day 7LeetCode279. Perfect Squares 题目描述 给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 示例 1: 输入: n = 12 输出: 3 解释: 12 = 4 + 4 + 4

  • LeetCode977.Squares of a Sorted Array2019-05-09 09:45:00

    题目 977. Squares of a Sorted Array Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Example 1: Input: [-4,-1,0,3,10] Output: [0,1,9,16,100] Example 2: Input: [-

  • 数字列表处理2019-04-27 09:52:37

    for value in range(1,5): print(value) print("----") for value in range(1,6): print(value) print("----") numbers = list(range(1,6)) print(numbers) print("----") even_numbers = list(range(2,11,2)) print(even_numbers) prin

  • POJ 1038 Bugs Integrated, Inc.(状压dp)2019-04-11 20:54:52

    Bugs Integrated, Inc. Time Limit: 15000MS   Memory Limit: 30000K Total Submissions: 10944   Accepted: 4234 Case Time Limit: 5000MS Description Bugs Integrated, Inc. is a major manufacturer of advanced memory chips. They are launching production of a

  • P1879 [USACO06NOV]玉米田Corn Fields (状压DP)2019-04-11 13:54:48

    P1879 [USACO06NOV]玉米田Corn Fields 题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some

  • HDU 1264 Counting Squares (线段树-扫描线-矩形面积并)2019-04-05 19:52:41

    Problem A : Counting Squares From:HDU, 1264 Problem Description Your input is a series of rectangles, one per line. Each rectangle is specified as two points(X,Y) that specify the opposite corners of a rectangle. All coordinates will be integers in the r

  • Square Destroyer-POJ 1084 (IDA*)2019-03-31 21:37:35

    Description The left figure below shows a complete 3*3 grid made with 2*(3*4) (=24) matchsticks. The lengths of all matchsticks are one. You can find many squares of different sizes in the grid. The size of a square is the length of its side. In the grid

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有