• bzoj2489


    这种题完全可以暴力找规律,暴力打表各种搞法

    这里有一篇比较全面的题解:http://acm.uestc.edu.cn/bbs/read.php?tid=3698&page=1&toread=1#tpc

     1 var f:array[0..1510] of extended;
     2     n,m,i,j,t:longint;
     3 
     4 function pow(x,y:longint):extended;
     5   var i:longint;
     6   begin
     7     pow:=1;
     8     for i:=1 to y do 
     9       pow:=pow*x;
    10   end;
    11 
    12 function C(n,m:longint):extended;
    13   var i:longint;
    14   begin
    15     C:=1;
    16     for i:=1 to m do
    17     begin
    18       C:=C*(i+m);
    19       C:=C/i;
    20     end;
    21   end;
    22 
    23 begin
    24   f[1]:=1;
    25   for i:=2 to 1500 do
    26   begin
    27     j:=i-i and 1;
    28     f[i]:=f[i-1]+C(j,j shr 1)/pow(2,j);
    29   end;
    30   readln(t);
    31   for i:=1 to t do
    32   begin
    33     readln(n);
    34     writeln('Case ',i,': ',f[n]:0:6);
    35   end;
    36 end.
    View Code
  • 相关阅读:
    HUST 1017 Exact cover (Dancing links)
    HDU 1160 FatMouse's Speed (DP)
    HDU 1058 Humble Numbers (DP)
    Kubernetes(k8s)
    linux命令
    入侵检测系统
    lynis检测
    CPU死锁
    检测工具lynis
    Linux表面工作
  • 原文地址:https://www.cnblogs.com/phile/p/4609532.html
Copyright © 2020-2023  润新知