Additive Number Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. ...
分类:
其他好文 时间:
2020-07-27 17:46:30
阅读次数:
60
题目描述: 给定字符串 s 和 t ,判断 s 是否为 t 的子序列。 你可以认为 s 和 t 中仅包含英文小写字母。字符串 t 可能会很长(长度 ~= 500,000),而 s 是个短字符串(长度 ?100)。 字符串的一个子序列是原始字符串删除一些(也可以不删除)字符而不改变剩余字符相对位置形成 ...
分类:
其他好文 时间:
2020-07-27 13:58:41
阅读次数:
73
使用python的时候经常会遇到文本的编码与解码问题,其中很常见的一种解码错误如题目所示, 1、编码设置 第一行没有设置 # _*_ coding:utf-8 _*_ 2、后面处理数据时没有转码下,如open函数上 处理如下:with open("data.txt",'r',encoding='UT ...
分类:
其他好文 时间:
2020-07-26 22:53:19
阅读次数:
74
在获取yaml文件数据时,提示:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 2: illegal multibyte sequence import yaml def test_yaml(): with ope ...
分类:
编程语言 时间:
2020-07-26 16:00:12
阅读次数:
88
单例 A single-element enum type is often the best way to implement a singleton. 单元素的枚举类型已经成为实现Singleton的最佳方法。 一般有两种方式,对于比较简单的效果实现,可以直接在枚举里写方法。 public en ...
分类:
其他好文 时间:
2020-07-26 15:34:09
阅读次数:
55
StackExchange.Redis client best practices 1. Enabling server GC can optimize the client and provide better performance and throughput.2. Set AbortOnCo ...
分类:
其他好文 时间:
2020-07-25 23:55:39
阅读次数:
84
DNA sequence HDU - 1560 题意: 给定N个DNA序列(仅由ATCG构成),求能使得这N个序列均为其子序列的最短公共序列,输出这个最小的长度。 思路: IDA*,估价函数即N个序列中未匹配个数的最大值。(因为最理想情况是,当前所尝试的字母X加入公共序列之后,能同时与这N个序列匹配 ...
分类:
其他好文 时间:
2020-07-25 23:40:46
阅读次数:
67
Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem which gives the short ...
分类:
其他好文 时间:
2020-07-24 21:53:35
阅读次数:
107
比赛链接:https://codeforces.com/contest/1390 A. 123-sequence 题意 给出一个只含有 $1,2,3$ 的数组,问使所有元素相同至少要替换多少元素。 题解 统计数组中出现次数最多的元素即可。 代码 #include <bits/stdc++.h> us ...
分类:
其他好文 时间:
2020-07-24 21:43:12
阅读次数:
67
1、菜单视图属性: 常用属性: name是展示在用户界面中的菜单项标题 action是点击菜单项时运行的窗口操作的XML ID parent是父级菜单项的XML ID。本例中父级项由其它模块创建,因此们使用了完整的XML ID, <module>.<XML ID>进行引用。 还有以下可用属性: se ...
分类:
其他好文 时间:
2020-07-24 21:28:23
阅读次数:
139