1.一般用C语言节约空间,要用C++库函数或STL时才用C++;cout、cin和printf、scanf最好不要混用。大数据输入输出时最好不要用cin、cout,防止超时。2.有时候int型不够用,可以用long long或__int64型(两个下划线__)。值类型表示值介于 -2^63 ( -9...
分类:
其他好文 时间:
2014-08-13 12:54:16
阅读次数:
186
在日常编程中--包括对话框、关系数据库、金融程序、SMS程序及一切处理数据文件的程序,需要控制小数点后的小数位的情况非常普遍,本文中将要讲 解如何用简单的方法来控制小数位,另外,还要揭开字符串及数据精度的一点点小秘密。问题的引出如有一个函数,其可接受一个long double参数,并将参数转换为字符...
分类:
编程语言 时间:
2014-08-13 12:28:36
阅读次数:
285
如何把数据上传到web应用
应用界面:
视频名称:title
时长:timelength
保存,点击保存按钮提交到web应用中,web应用中开发Manageservlet来接收数据。
get方式
服务端:
public class ManageServlet extends HttpServlet
{
private static final long serialVersi...
分类:
移动开发 时间:
2014-08-13 10:40:45
阅读次数:
221
/**
* 功能:联合体使用
* 时间:2014年8月1日17:04:23
* 作者:cutter_point
*/
#include
#include
using namespace std;
union Packed
{
char i;
short j;
int k;
long l;
float f;
double d; //这个联合体...
分类:
编程语言 时间:
2014-08-13 10:39:05
阅读次数:
262
高精度加法。水。
给一长串的数字,加起来就好。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x7fffffff
#define eps 1e-6
#define LL long long
#defi...
分类:
其他好文 时间:
2014-08-13 10:38:25
阅读次数:
206
很裸的dp
状态转移方程 dp[i]=max(dp[i-1],dp[i-2]+dp[i]*i)
#include
using namespace std;
long long dp[100020];
int main()
{
int n,a;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d...
分类:
其他好文 时间:
2014-08-13 10:36:25
阅读次数:
195
Problem Description
Jerboas are small desert-living animals, which resemble mice with a long tufted tail and very long hind legs. Jerboas shelter in well-hidden burrows. They create two types o...
分类:
其他好文 时间:
2014-08-13 10:33:25
阅读次数:
259
#include
#include
typedef unsigned long long ll;
const ll MOD = (1ULL<<32);
const int N = 500001;
int t, n;
ll ans[N], frc[N];
void init() {
for (ll i = 1; i < N; i++) {
for (ll j = i; j < ...
分类:
其他好文 时间:
2014-08-13 01:14:05
阅读次数:
218
典型的DP题目,增加一个额外要求,输出子序列的开始和结尾的数值。
增加一个记录方法,nothing special。
记录最终ans的时候,同时记录开始和结尾下标;
更新当前最大值sum的时候,更新开始节点。
const int MAX_N = 10001;
long long arr[MAX_N];
int N, sta, end;
long long getMaxSubs()
{
...
分类:
其他好文 时间:
2014-08-12 22:04:14
阅读次数:
320
poj2774:http://poj.org/problem?id=2774题意:题解: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=220010; 6 char str[maxn]; ...
分类:
其他好文 时间:
2014-08-12 21:32:44
阅读次数:
267