题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3681
E - Cup 2
Time Limit: 2 Seconds Memory Limit: 65536 KB
The European Cup final is coming. The past two World C...
分类:
其他好文 时间:
2014-05-15 14:56:27
阅读次数:
393
OJ题目:click here~~
题目分析:有n条路径逃出洞穴,第i条路径有一个难度值ci。某人开始有战斗值f,每天随机选择某一条路径想要逃出。只要此时的 f 大于所选路径的ci,就能花费ti的天数逃出。这里。否则,等待明天再试吧,但是战斗值能增加ci。求逃出的期望天数。
设dp[ i ] 为战斗值为i时,逃出的期望天数。详细解释见代码。
AC_CODE
int const maxn =...
分类:
其他好文 时间:
2014-05-15 06:38:40
阅读次数:
406
/*
* hdu AC Me
* date 2014/5/13
* state AC
*/
#include
#include
#include
#include
using namespace std;
const int MAXN=100001;
char Arr[MAXN];
int cnt[26];
int main()
{
//cout << "Hello wor...
分类:
其他好文 时间:
2014-05-15 06:16:24
阅读次数:
247
window.document.onkeydown = disableRefresh;
function disableRefresh(evt){
evt = (evt) ? evt : window.event
if (evt.keyCode) {
if(evt.keyCode == 116){
//do something
}
}
}
keycode 8...
分类:
Web程序 时间:
2014-05-15 06:08:18
阅读次数:
315
【题目】
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Out...
分类:
其他好文 时间:
2014-05-15 05:13:49
阅读次数:
306
【题目】
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
【题意】
题意是找出字符串S中最长回文子串,S最长为1000,保证有唯一解
【思路】
原字符串用特殊字符#间隔,如下所示:
#a...
分类:
其他好文 时间:
2014-05-15 03:31:25
阅读次数:
299
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3682
E - Cup 3
Time Limit: 3 Seconds Memory Limit: 65536 KB
The 2012 Europe Cup was over and Spain won the Champio...
分类:
其他好文 时间:
2014-05-15 03:30:08
阅读次数:
370
#include
#include
void main(int argc,char *argv[])
{
FILE *in,*out;
if(argc!=3)
{
printf("you forgot to enter a file name\n");
exit(0);
}
if((in=fopen(argv[1],"r"))==NULL)
{
printf("cannot...
分类:
编程语言 时间:
2014-05-14 21:37:56
阅读次数:
321
描述把文本读出的API,在手机上测试知识支持英文,中文库应该没有所以不支持
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file exce...
分类:
移动开发 时间:
2014-05-14 21:34:49
阅读次数:
435
【题目】
Determine whether an integer is a palindrome. Do this without extra space.
【题意】
题意判断一个整数是否是回文数
注意一下几点:
1. 不能用额外的空间
2. 负数不是回文数...
分类:
其他好文 时间:
2014-05-14 20:31:10
阅读次数:
298