码迷,mamicode.com
首页 >  
搜索关键字:sum problem    ( 57617个结果
Leetcode 59. 螺旋矩阵 II
地址 https://leetcode-cn.com/problems/spiral-matrix-ii/ 给你一个正整数 n ,生成一个包含 1 到 n2 所有元素,且元素按顺时针顺序螺旋排列的 n x n 正方形矩阵 matrix 。 示例 1: 输入:n = 3 输出:[[1,2,3],[8, ...
分类:其他好文   时间:2021-04-06 14:49:59    阅读次数:0
Codeforces Round #712 (Div. 2) C
题目链接 https://codeforces.ml/contest/1504/problem/C 题目截图 题目大致描述 给定一个01串,判断是否能构造出两个平衡的括号序列ans1和ans2,若能给定其中一种解,构造需满足以下规则: 对于01串中元素为0的位置i,ans1[i] != ans2[i ...
分类:其他好文   时间:2021-04-06 14:45:19    阅读次数:0
CCF2019-09-Python题解
小明种树 试题编号: 201909-1 试题名称: 小明种苹果 时间限制: 2.0s 内存限制: 512.0MB 题解:模拟一下,记录坏果数量和对应的果树的序号,排下序 3 3 73 -8 -6 -4 76 -5 -10 -8 80 -6 -15 0 1 n,m=map(int, input().s ...
分类:编程语言   时间:2021-04-06 14:37:49    阅读次数:0
Solution -「CF 392C」Yet Another Number Sequence
Description Link. 求 \(\sum_{i=1}^{n}\text{fibonacci}_{i}\times i^{k}=\sum_{i=1}^{n}(F_{i-1}+\text{fibonacci}_{i-2})\times i^{k}\),\(1\le n\le10^{17},1 ...
分类:其他好文   时间:2021-04-06 14:07:28    阅读次数:0
AtCoder Beginner Contest 049 B - Thin
Problem Statement There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The charact ...
分类:其他好文   时间:2021-04-05 12:52:04    阅读次数:0
4D - Mysterious Present 二维最长上升子序列
原题链接https://codeforces.com/problemset/problem/4/D 题意:给你n个二元组和起始条件,求其最大二维上升子序列,并输出选择编号。 思路:按照一个维度排序,然后DP即可,注意细节。 代码如下 int n, w, h; struct node{ int w, ...
分类:其他好文   时间:2021-04-05 12:33:56    阅读次数:0
hdu3639Hawk-and-Chicken(无向图缩点+dfs)
题目描述: Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play th ...
分类:其他好文   时间:2021-04-05 12:24:28    阅读次数:0
Leetcode 524. Longest Word in Dictionary through Deleting
Description: Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the gi ...
分类:其他好文   时间:2021-04-05 12:21:20    阅读次数:0
B. The least round way
原题链接https://codeforces.com/problemset/problem/2/B 这题要特判矩阵里有0的情况,我就没特判,一直TLE(自己傻逼) 题意:给你一个矩阵,里面都是非负数,现在让你从$(1, 1)\(走到\)(n, n)$, 并且把路径上的所有数乘起来,问你能得到的数末尾 ...
分类:其他好文   时间:2021-04-05 12:16:09    阅读次数:0
拉格朗日插值
\(f(k) = \sum_{i = 1}^{n} y_i \prod_{i \not = j} \frac{k - x_j}{x_i - x_j}\) 证明直接带入,假设$k=x_1$,那么除了第一项,别的每一项都会有$(x_1-x_1)$的分子,乘起来都是$0$。而第一项,后面累乘的每项都恰好为 ...
分类:其他好文   时间:2021-04-05 12:12:01    阅读次数:0
57617条   上一页 1 ... 26 27 28 29 30 ... 5762 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!