from PIL import Image from PIL import ImageDraw, ImageFont import random def get_valid_img(request): def get_random_color(): return (random.randint(0,... ...
分类:
其他好文 时间:
2018-10-14 13:38:24
阅读次数:
221
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No ...
分类:
其他好文 时间:
2018-10-13 11:43:02
阅读次数:
113
https://leetcode.com/problems/longest-valid-parentheses/description/ 来回做了好几遍,虽然AC 了但是这个解发肯定不是最优的。思路是把问题分两步解决:1. 把字符串转换成一个匹配括号的id 序列,比如第0 个和第3 个匹配了,则把0 ...
分类:
其他好文 时间:
2018-10-12 16:07:49
阅读次数:
106
Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Example 2: Note:You may assume the string contains only ...
分类:
其他好文 时间:
2018-10-11 15:44:25
阅读次数:
181
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Exampl ...
分类:
其他好文 时间:
2018-10-11 01:35:51
阅读次数:
147
Flow Control and Window Management Every TCP segment (except those exchanged during connection establishment) includes a valid Sequence Number field, ...
建模思路跟之前的一样,宫的话dfs搜索一下找联通分量就行,好像也没有更好的办法,有的话请评论哈orz ——因为舞蹈链一般找到解以后就直接跳出了,所以ans数组就是ans不会再变。但这题让找一下有没有多组解,所以就不能找到一个解后直接跳出。就有一个小坑是都搜完后ans数组可能不是合法ans,所以找到第 ...
分类:
其他好文 时间:
2018-10-05 21:57:40
阅读次数:
254
以上是全部代码,附上几个生成的数独: 2 9 8 1 5 6 7 3 4 6 7 1 8 4 3 5 2 9 3 4 5 2 7 9 8 6 1 8 1 9 6 3 7 4 5 2 4 2 6 5 8 1 9 7 3 7 5 3 9 2 4 1 8 6 1 3 2 7 9 5 6 4 8 5 6 4 ...
分类:
其他好文 时间:
2018-10-05 20:22:31
阅读次数:
186
一、PSP(个人软件过程) Planning 二、项目要求 1.目标:随机生成N个已解答完毕的的数独棋盘矩阵,在控制台中键入"xxxx.exe -c N"格式的命令后将矩阵输出到当前路径下的‘sudoku.txt’文件中。 2.限制条件:N值为0~1000000,矩阵不重复。 三、算法思路 1.利用 ...
分类:
其他好文 时间:
2018-10-05 17:14:51
阅读次数:
190
题意 "题目链接" Sol 非常妙的一道题。。 可以这样想,在BFS序中较早出现的一定是先访问的,所以把每个点连出去的边按出现的前后顺序排个序 看一下按顺序遍历出来的序列与给出的是否相同就行了 cpp include using namespace std; const int MAXN = 2e5 ...
分类:
其他好文 时间:
2018-10-05 12:25:49
阅读次数:
117