C语言 int maxProfit(int* prices, int pricesSize) { int dp[pricesSize][2]; dp[0][0] = 0, dp[0][1] = -prices[0]; for (int i = 1; i < pricesSize; ++i) { dp ...
分类:
编程语言 时间:
2021-06-11 18:18:14
阅读次数:
0
T1打包 一个二维01背包的板子,状态转移方程$$Dp_{j,k}=max\left \{Dp_{j,k},Dp_{j-Weight_i,k-V_i}+Value_i\right \}$$ T2暗黑破坏神 大概类似于分组背包,开$long\ long$,在更新$Dp$的过程中记录路径,递归输出即可。 ...
分类:
其他好文 时间:
2021-06-11 18:06:14
阅读次数:
0
任何容器的底层数据结构只有两种:一种是数组;另一种是链表。例如:list,set,map,二叉树,图等容器。访问容器使用Iterator迭代器。 public interface Collection_ { void add(Object o); int size(); Iterator_ iter ...
分类:
其他好文 时间:
2021-06-10 18:43:23
阅读次数:
0
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi ...
分类:
其他好文 时间:
2021-06-10 18:39:18
阅读次数:
0
问题描述: 在pytorch中,利用nn.CrossEntropyLoss()求取的loss值是一个tensor标量,但是利用mindspore中nn.SoftmaxCrossEntropyWithLogits()求取的loss值是一个矢量(因为batct_size是32,所以求得的loss也是一个 ...
分类:
其他好文 时间:
2021-06-10 18:33:56
阅读次数:
0
#COMMAND="hive -i settings/load-${SCHEMA_TYPE}.sql -f ddl-tpch/bin_${SCHEMA_TYPE}/${t}.sql \ # -d DB=${DATABASE} \ # -d SOURCE=tpch_text_${SCALE} -d B ...
分类:
其他好文 时间:
2021-06-10 18:25:11
阅读次数:
0
有关Array的方法: 1._.chunk(array, [size=1]),返回size长度数组组成的新数组 _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']] _.chunk(['a', 'b', 'c', 'd'], ...
分类:
其他好文 时间:
2021-06-10 18:10:30
阅读次数:
0
创建数据库:mysql> create database test default character set utf8; 查看数据库:mysql> show databases; 查看数据库编码:mysql> select schema_name,default_character_set_nam ...
分类:
数据库 时间:
2021-06-10 18:03:00
阅读次数:
0
1. 内存管理**malloc和free** void *zmalloc(size_t size); // 对malloc的封装 void *zcalloc(size_t size); // 对calloc的封装 void *zrealloc(void *ptr, size_t size); // ...
分类:
其他好文 时间:
2021-06-10 18:00:14
阅读次数:
0
简介 思路: 个数和序号相等 code class Solution { int size = 0; int maxCode = 0; public boolean isCompleteTree(TreeNode root) { if(root == null) return true; recur ...
分类:
其他好文 时间:
2021-06-10 17:38:44
阅读次数:
0