题目链接 Problem Description Little Q wants to buy a necklace for his girlfriend. Necklaces are single strings composed of multiple red and blue beads.Lit ...
分类:
移动开发 时间:
2018-10-04 08:54:29
阅读次数:
200
Given two binary strings, return their sum (also a binary string). The input strings are both non empty and contains only characters 1 or 0. Example 1 ...
分类:
其他好文 时间:
2018-10-02 17:36:11
阅读次数:
189
Find a longest common subsequence of two strings. First and second line of each input case contain two strings of lowercase character a…z. There are n ...
分类:
其他好文 时间:
2018-10-02 17:24:56
阅读次数:
122
from: https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/strings/ C#提供了别名string来代表System.String类。如果在代码中使用String类,必须载入包 using System;而使用内 ...
题目 Given two binary strings, return their sum (also a binary string). The input strings are both non empty and contains only characters 1 or 0. Exampl ...
分类:
其他好文 时间:
2018-10-01 11:52:46
阅读次数:
104
最近项目中运用到了R读取文件数据,所以把相关好用的、经过验证的方法总结了一下,有效避免下次入坑。 1. R读取txt文件 使用R读取txt文件直接使用read.table()方法进行读取即可,不需要加载额外的包。 1 注意,此处的na.strings = c("NA") 的意思是文件中的缺失数据都是 ...
分类:
编程语言 时间:
2018-09-30 16:38:59
阅读次数:
385
题目大意:甲和乙玩游戏,甲给出n(n<=50)个等长的字符串(len<=20),然后甲选出其中一个字符串,乙随机询问该字符串某一位的字符(不会重复询问一个位置),求乙能确定该串是哪个字符串的询问次数的期望值 这题不看题解好难想......(感谢zhx和zhx两位大佬的题解) len很小,考虑状压DP ...
分类:
其他好文 时间:
2018-09-24 23:19:20
阅读次数:
161
题意 你和你的朋友玩一个游戏,游戏规则如下。 你的朋友创造 n 个长度均为 m 的不相同的字符串,然后他随机地选择其中一个。他选择这些字符串的概率是相等的,也就是说,他选择 n 个字符串中的每一个的概率是 1/n 。你想猜猜你的朋友选择了哪个字符串。 为了猜到你的朋友选择了哪个字符串,你可以问他问题 ...
分类:
其他好文 时间:
2018-09-24 16:36:18
阅读次数:
136
You are given two strings ss and tt, both consisting only of lowercase Latin letters. The substring s[l..r]s[l..r] is the string which is obtained by ...
分类:
其他好文 时间:
2018-09-24 11:23:55
阅读次数:
202
题目链接:868D - Huge Strings 题目大意:有\(n\)个字符串,\(m\)次操作,每次操作把两个字符串拼在一起,并询问这个新串的价值。定义一个新串的价值\(k\)为:最大的\(k\),使得这个新串包含所有长度为\(k\)的01串(这样的字符串有\(2^k\)个) 题解:首先来证明对 ...
分类:
其他好文 时间:
2018-09-23 22:40:28
阅读次数:
453