newwork setup

Posted 学院派的驴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了newwork setup相关的知识,希望对你有一定的参考价值。

#-*-coding:utf-8-*-
#########################################################################
#   Copyright (C) 2017 All rights reserved.
# 
#   FileName:GetLongestSubString.py
#   Creator: x‘x‘[email protected]
#   Time:06/02/2017
#   Description:
#
#   Updates:
#
#########################################################################
#!/usr/bin/python
# please add your code here!
import re;
import sys;
import time;
def PrintUsage():
    sys.stderr.write("program [IN]\n");
    sys.exit(1);
class Solution:
    def GetLongestSubString(self,s1,s2):
        ‘‘‘
         compute longest substring of input string s1 and s2
        ‘‘‘
        maxLen = 0;
        endIndex = 0;
        print("s1="+s1);
        print("s2="+s2);
        if ( len(s1) == 0 or len(s2) == 0 ):
            return "";
        table=[[] for i in range(len(s1))];
        for i in range(len(table)):
            table[i]=[0 for j in range(len(s2))];
        for i in range(0,len(s1)):
            for j in range(0,len(s2)):
                if ( i == 0 or j == 0 ):
                    if ( s1[i]==s2[j] ):
                        table[i][j] = 1;
                        if ( table[i][j] > maxLen ):
                            maxLen = table[i][j];
                            endIndex = i;
                else:
                    if ( s1[i]==s2[j] ):
                        table[i][j] = table[i-1][j-1]+1;
                        if (table[i][j] > maxLen):
                            maxLen = table[i][j];
                            endIndex = i;
        print(table);
        return s1[endIndex-maxLen+1:endIndex+1];
if (__name__=="__main__"):
    if (len(sys.argv) != 1):
        PrintUsage();
        sys.exit(1);
    starttime = time.clock();
    s1="gcdef";
    s2="abcdef";
    sol = Solution();
    print(sol.GetLongestSubString(s1,s2));
    endtime = time.clock();
    interval = endtime - starttime;
    sys.stderr.write("%s has finished congratulations!\n"%str(sys.argv[0]));
    sys.stderr.write("time elapse:%f\n"%interval);

 

以上是关于newwork setup的主要内容,如果未能解决你的问题,请参考以下文章

我可以使用 WixBundleDirectoryLayout 或 /layout 示例片段吗?

龟图形 - 尝试获取背景图像失败?

用于发布的FireAndForget和Async行为之间的差异

vue3.2 基础及常用方法

线程池框架

使用 Setup 将Python 代码 打包