Welcome, Guest! Sign Up RSS

Clever Space

Friday, 11.22.2024

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<queue>
#include<list>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define mmt(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define y1 fuck
using namespace std;
typedef long long LL;
typedef long double LD;
int n,lim;
LL f(int k)
{
  if (lim>k-1) return k-1;
  return max(k-1-((k-lim-1)<<1),0);
}
int main()
{
  int n,i;
  scanf("%d",&n);
  lim=n/2-1;
  if (n%2==1) lim++;
  LL ans=0;
  FOR(i,2,n-2)
  ... Read more »

Views: 272 | Added by: dhy0077 | Date: 11.06.2014

f[i][j]=f[i-1][j-1]+

位置数N 
N=7

case 1 
sum=

i-1=3
AB..... 3
A.B.... 2
A..B... 1
A...B.. 1
A....B. 2
A.....B 3
ABC.... 2
AB.C... 1
7-3 4
3
4=1+1+2
4=1+3
4=4
f1[i][j]
f2[i][j]
f3[i][j]

Views: 243 | Added by: dhy0077 | Date: 09.24.2014

二分答案,判断是否有一组解的F值小于0

Code:b3477.html

Views: 460 | Added by: dhy0077 | Date: 08.15.2014

float a[MAX][MAX], b[MAX], c[MAX], x[MAX], v;
int n, m;

void pivot(bool flag_row[], bool flag_column[], float c[MAX], int l, int e)
{
 //计算原等式变形系数
  ... Read more »

Views: 599 | Added by: dhy0077 | Date: 08.03.2014

复数类:cpx

FFT主过程:FFT_main

一个范例:FFT_sample

 

Views: 291 | Added by: dhy0077 | Date: 07.20.2014

double PI=3.1415926535898;
double dis(const Point &a,const Point &b)
{
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); 

Point circumcenter(const Point &a,const Point &b,const Point &c)
{ //返回三角形的外心 
    Point ret; 
    double a1=b.x-a.x,b1=b.y-a.y,c1=(a1*a1+b1*b1)/2;
    double a2=c.x-a.x,b2=c.y-a.y,c2=(a2*a2+b2*b2)/2;
    double d=a1*b2-a2*b1;
    ret.x=a.x+(c1*b2-c2*b1)/d;
    ret.y=a.y+(a1*c2-a2*c1)/d;
    return ret; 

void min_cover_circle(Point *p,int n,Point &c,double &r){ //c为圆心,r为半径 
    random_shuffle(p,p+n); // 
    c=p[0]; r=0;
    for(int i=1;i<n;i++)
    {
        if(dis(p[i],c)>r+eps)  //第一个点
      & ... Read more »

Views: 533 | Added by: dhy0077 | Date: 07.20.2014

我发现自己真是个大NC

3295: [Cqoi2011]动态逆序对:这个题的话要把区间修改,单点查询转为区间查询,单点修改 否则如果打标记的话复杂度会不对。

3524: [Poi2014]Couriers:区间众数是没法维护的,但是子树大小大于等于(r-l+1)/2的子树一定包括答案,所以就可以搞了

 

 

Views: 580 | Added by: dhy0077 | Date: 06.09.2014

2303 2809 1913 2327

Views: 338 | Added by: dhy0077 | Date: 06.04.2014

Views: 447 | Added by: dhy0077 | Date: 06.04.2014

都是水题

Views: 279 | Added by: dhy0077 | Date: 06.03.2014

1 2 3 ... 13 14 »