/ Vijos / 讨论 / 选数 /

第三个点怎么没过去?

var a,b:array[0..20]of longint;

v:array[1..20]of boolean;

n,k,i:integer;

sum:int64;

function check(a:longint):boolean;

var i:longint;

begin

for i:=2 to trunc(sqrt(a)) do

if a mod i=0 then exit(false);

exit(true);

end;

procedure solve(i:integer);

var j:integer;

m:longint;

begin

if i=k+1 then

begin

m:=0;

for j:=1 to k do inc(m,b[j]);

if check(m) then inc(sum);

exit

end;

for j:=1 to n do

if (not v[j])and(b

4 条评论

  • @ 2015-02-13 11:33:35

    good!
    god!
    gd!
    g!

  • @ 2015-02-13 11:33:13

    呵呵呵呵呵额呵呵呵

  • @ 2015-02-13 11:33:05

    呵呵

  • @ 2014-09-28 11:11:58

    var
    si,xi:array[1..20] of longint;
    j,t,c,d,e,f,g,n,k:longint;
    procedure my;
    begin
    for c:=1 to k do
    d:=si[xi[c]]+d;
    for e:=2 to d-1 do
    if d mod e=0 then
    begin
    f:=1;
    break;
    end;
    if f=0 then g:=g+1;
    f:=0;
    d:=0;
    j:=k;
    while (j>0)and(xi[j]=n+j-k) do
    j:=j-1;
    if j>0 then
    begin
    inc(xi[j]);
    for t:=j+1 to k do
    xi[t]:=xi[t-1]+1;
    end;
    end;
    begin
    readln(n,k);
    for j:=1 to n do
    read(si[j]);
    for j:=1 to k do
    xi[j]:=j;
    while j<>0 do
    my;
    writeln(g);
    end.

  • 1

信息

ID
1128
难度
4
分类
搜索 | 搜索与剪枝 点击显示
标签
递交数
5816
已通过
2645
通过率
45%
被复制
28
上传者