01-07都没写...然后突然来写貌似有点突兀啊...不管了,难得前排记录一下...

吐槽一下赛制...不得不说很强... cf 套oi...很创新...不过还是兹磁ACM或者CF

A-1

数据才2<=n<=3 ...但是一眼过去就先打了个dfs 。

所以这个应该是A-2的题解。

a1应该打表就好了...

A-2

这个就是dfs啊...

搜索出所有的s串的子集,然后暴力判一下...

var s:string;
    a:array[0..100]of string;
    i,j:longint;
    tot,x:longint;
procedure dfs(dep,last:longint;t:string);
var i:longint;
begin
  if dep>1 then
  begin
    inc(tot);
    a[tot]:=t;
  end;
  for i:=last+1 to length(s) do
  dfs(dep+1,i,t+s[i]);
end;
begin
  readln(s);
  dfs(1,0,'');
  for i:=1 to tot do
  begin
    x:=0;
    for j:=1 to tot do
    if (a[i]=a[j])and(length(a[i])=length(a[j])) then inc(x);
    if x=2 then
    begin
      writeln('Y');
      exit;
    end;
  end;
  writeln('N');
end.
A-2

相关文章: