递推DP,最可恶的是zoj竟然不认I64d!!!只认lld!!!wa了无数遍~
#include<iostream>
#include<vector>
#include<map>
#include<stack>
#include<algorithm>
#include<queue>
#include<list>
#include<set>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdio.h>
#include<ctype.h>
#include<iomanip>
using namespace std;
#define LL long long
#define pi acos(-1)
#define FRE freopen("a.txt","r",stdin)
#define INF 9999999999
#define eps 1e-6
#define N 100005
LL dp1[N];
int main(){
LL n;
LL i,j;
dp1[1]=0;
dp1[2]=1;
dp1[3]=2;
dp1[4]=4;
LL s1=2,s2=3;
for(i=5;i<=100000;i++){
if(i&1)
{
dp1[i]=dp1[i-1]+s1;
s1++;
}
else
{
dp1[i]=dp1[i-1]+s2;
s2++;
}
}
return 0;
}