
数据结构与算法
文章平均质量分 92
付
这个作者很懒,什么都没留下…
展开
-
leetcode-131 分割回文串 go 实现
题目描述给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。返回 s 所有可能的分割方案。分割回文串输入:“aab”输出:[ [“aa”,“b”], [“a”,“a”,“b”] ]题解基本思想参考 dfs+回溯 题解方案,用go语言重新实现了一遍。中间碰到了暴露了自己回溯、动态规划、递归短板,同时一窥 go语言 slice append 用法之谜。packag...原创 2019-12-07 19:32:10 · 456 阅读 · 0 评论 -
ACM-1002
原文地址: 杭电acm 1002请各位帮我看下,我这个代码为何是WrongAnswer,是不是因为我的数据范围的问题,还是思路不正确?#include<stdio.h>main(){ _int64 c[20][2]= {0}; int n,j; _int64 a,b; while(scanf("%d",&n)!=EOF &&am...原创 2014-07-11 17:09:26 · 591 阅读 · 0 评论 -
ACM 1002新版本
#include<string.h>main(){ void reverse(char *str); char a[20][1001]={'\0'},b[20][1001]={'\0'};//存放a,b 序列的数组; int n; while(scanf("%d",&n)!=EOF&&n>=1 &...原创 2014-07-13 10:44:54 · 752 阅读 · 1 评论 -
ACM1003
#include<stdio.h>#include<string.h>main(){ static int arr[20][100000]; int i,j,a,n=0,t,result=0,sum=0; scanf("%d",&t);//准备输入几行t=2 if(t>=1&&t<=20){ ...原创 2014-07-23 16:26:06 · 633 阅读 · 0 评论 -
Two Sum
</pre><pre name="code" class="java"><p style="margin-top: 0px; margin-bottom: 20px; padding-top: 0px; padding-bottom: 0px; border: 0px; outline: 0px; font-size: 13px; vertical-align: b...原创 2015-03-18 20:21:54 · 457 阅读 · 0 评论