摘要: input 6 11 1 2 1 3 1 4 1 5 1 6 2 4 2 5 2 6 3 4 3 5 3 6 output 1 2 2 3 3 3 input 4 6 1 2 1 3 1 4 2 3 2 4 3 4 output -1 #题意 在一张无向图(无自环,不一定联通)中,将所有节点划分为三 阅读全文
posted @ 2020-10-13 00:41 youngman-f 阅读(62) 评论(0) 推荐(0) 编辑
摘要: input abba output 6 1 0 0 input abacaba output 12 4 1 0 0 0 0 #题意: 1-palindromes:该字符串为一个回文字符串 k-palindromes满足: 1.该字符串为一个回文字符串 2.其左边以及右边是一个(k-1)-palind 阅读全文
posted @ 2020-10-13 00:15 youngman-f 阅读(98) 评论(0) 推荐(0) 编辑