S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per ...
分类:
其他好文 时间:
2018-07-21 19:17:04
阅读次数:
210
构建函数,创建模块,安装发布文件,安装pytest和PEP 8插件,确认PEP8兼容性以及纠错 ...
分类:
编程语言 时间:
2018-07-20 21:18:15
阅读次数:
277
题意:给你一个字符串,和每个位置可能的字符(没有就可以放任意字符)要求一个排列使得每个位置的字符在可能的字符中,求字典序最小的那个 题解:很容易判断有没有解,建6个点表示从a f,和源点连边,容量为原串字符出现次数,再建64个点表示给定的位置的每一个状态,和汇点连边,容量为出现次数,如果a f某个字 ...
分类:
其他好文 时间:
2018-07-20 00:25:54
阅读次数:
177
#include<stdio.h> int main(){ char c; int letters=0,space=0,digit=0,other=0; printf("请输入一行字符:"); while ((c=getchar())!='\n') { if (c >= 'a'&&c <= 'z' ...
分类:
其他好文 时间:
2018-07-17 16:21:52
阅读次数:
202
pMsg.js demo.html pMsg("4单剩单单","注意",5000); ...
分类:
其他好文 时间:
2018-07-16 14:09:16
阅读次数:
164
link 题意: 给你一个长为n的串,字符集'a'~'f'。你可以重排这个串,满足指定m个位置上只能放特定的字符,m个位置以及字符集会给出。求字典序最小的串? $n,m\leq 10^5.$ 题解: 稍微需要那么一点技巧的贪心。 贪心策略比较显然,无非就是从左往右放尽可能小的字符,同时保证当前位置之 ...
分类:
其他好文 时间:
2018-07-15 16:11:18
阅读次数:
157
Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she ...
分类:
其他好文 时间:
2018-07-13 12:09:48
阅读次数:
190
问题描述: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empt ...
分类:
其他好文 时间:
2018-07-11 12:27:30
阅读次数:
172
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl ...
分类:
其他好文 时间:
2018-07-10 22:07:33
阅读次数:
153
class Solution { public String[] findWords(String[] words) { HashSet[] rows = new HashSet[3]; ArrayList result = new ArrayList(); String[] letters = {... ...
分类:
其他好文 时间:
2018-07-10 21:38:30
阅读次数:
164