题目:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you ca...
分类:
编程语言 时间:
2015-06-18 23:42:31
阅读次数:
198
#includeusing namespace std;#define N 10001int n;int v[N(n>>1)) return 0; for(int i=first[U];i;i=next[i]) if(v[i]!=fa[U]&&size[v[i]]>(n>>...
分类:
其他好文 时间:
2015-06-18 23:37:19
阅读次数:
177
#include#include#include#includeusing namespace std;#define N 50001int v[N=n) return; T[x]+=op; if(!T[x]) --sumv[nu2[x]]; else if(o...
分类:
其他好文 时间:
2015-06-18 23:33:29
阅读次数:
97
这题目我想到的是栈,当然感觉也是想多了,,
#include
#include
#include
using namespace std;
double round(double r)
{
return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
}
stackdata[100];
int sum;
int num;
int pre;
void...
分类:
其他好文 时间:
2015-06-18 22:20:47
阅读次数:
113
//暴力轮询法
#include
using namespace std;
int Grial(char *str1, char *str2)
{
if (str2 == NULL)return 1;
char *p1 = str1;
char *p2 = str2;
while (*p2 != '\0')
{
while...
分类:
编程语言 时间:
2015-06-18 22:16:20
阅读次数:
204
In Java, will the code in the finally block be called and run after a return statement is executed?
分类:
编程语言 时间:
2015-06-18 21:45:47
阅读次数:
116
欧拉函数模板//直接求解欧拉函数int euler(int n){ //返回euler(n) int res=n,a=n; for(int i=2;i*i1) res=res/a*(a-1); return res;}//筛选法打欧拉函数表#define Max 100000...
分类:
其他好文 时间:
2015-06-18 21:35:56
阅读次数:
113
struct TreeNode* invertTree(struct TreeNode* root){ if ( NULL == root ) { return NULL; } if ( NULL == root->left && NULL == root->r...
分类:
其他好文 时间:
2015-06-18 21:33:27
阅读次数:
106
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->...
分类:
其他好文 时间:
2015-06-18 19:58:22
阅读次数:
90
后台代码: public string title = "js调用后台属性值"; public void getContent() { return title; }前台代码: var title = "<%=getC...
分类:
Web程序 时间:
2015-06-18 19:41:54
阅读次数:
169