CanChen ggchen@mail.ustc.edu.cn Max Consecutive Ones II Given a binary array, find the maximum number of consecutive 1s in this array if you can flip ...
分类:
其他好文 时间:
2020-04-10 00:08:30
阅读次数:
81
In an n x n chessboard, Prince and Princess plays a game. The squares in the chessboard are numbered 1, 2, 3 ... n*n, as shown below:Prince stands in ...
分类:
其他好文 时间:
2020-04-09 12:37:11
阅读次数:
87
嘤嘤嘤,我又来了,刚A完就写,这个沙雕题有丶恶心 题目: In an n×n chessboard, Prince and Princess plays a game. The squares in the chessboard are numbered 1, 2, 3, . . . , n?n, ...
分类:
其他好文 时间:
2020-04-09 00:58:08
阅读次数:
300
GitHUB:https://github.com/daozhangXDZ/DZGameEngine 后续再把DZProgrameNote公开,正在批处理过程中。一堆markdown. MARKDOWN: ...
分类:
其他好文 时间:
2020-04-08 09:26:34
阅读次数:
58
在torchvision.transforms中常用的数据变换操作: torchvision.transforms.Resize:对图片数据按需求大小进行缩放,传递的参数为整型,(h,w)h表示高度,w表示高度 torchvision.transforms.Scale:对图片按需求大小进行缩放 to ...
分类:
其他好文 时间:
2020-04-07 20:29:54
阅读次数:
96
主循环: while mRunning: for event in pygame.event.get(): if event.type == pygame.QUIT: mRunning=False pygame.quit()必须要写成event.type要不退不出去,不生效 ...
分类:
其他好文 时间:
2020-04-07 18:16:48
阅读次数:
62
https://leetcode-cn.com/problems/stone-game-iii/ 题意:有n个数,有两个人,轮流取数,每次可以取前1、2、3个数,取到最后,谁的和大谁赢。 思路:类似上一篇,把数的大小看作收益,自己收益为x,别人收益为y,纯收益x-y。 不同取法都会对后面造成影响,但 ...
分类:
其他好文 时间:
2020-04-06 23:44:10
阅读次数:
97
题意:一个全排列,alice可以从某一个数出发,从i走到j的条件是: a[j]>a[i],而且从i到j要符合|i-j|%a[i]=0,若alice在该数有必胜的策略,输出B,否则A 思路,拓扑排序+博弈论(这题让我做的太迷了刚刚) ,用邻接表连接该数与其他数的关联,如果一开始入度为0的,即alice ...
分类:
编程语言 时间:
2020-04-06 17:25:52
阅读次数:
73
一、使用函数。 import random:import语句将random模块导入程序中。 guessesTaken = 0:储存猜过的次数。 random.randint():调用random中的randint(x,y)函数,此函数创建一个随机数字。 for i in range(6):range ...
分类:
其他好文 时间:
2020-04-06 11:43:24
阅读次数:
74
题目标签:Array 为了实现单调递增,需要把某些0变成1,或者某些1变成0,而且要返回的是“最少的反转次数”,这里要分两种情况: 1. 当 i - 1 是0: 那么 i 这个数字是0 或者 1 的话 都是递增; 2. 当 i - 1 是1: 那么 i 需要是 1 才能 继续保持递增。 利用动态规划 ...
分类:
其他好文 时间:
2020-04-06 10:02:41
阅读次数:
63