题解

98 条题解

  • 0
    @ 2009-01-17 22:27:48

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    竟然把n和m读反了,WA了2次

  • 0
    @ 2008-12-06 22:17:43

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    水题,把题目看仔细应该没问题

    为什么简单的题目总是要两次才AC !?

  • 0
    @ 2008-11-13 22:25:02

    const

    x1:array[1..8] of longint =(-1,-1,-1,0,0,1,1,1);

    y1:array[1..8] of longint= (-1,0,1,-1,1,-1,0,1);

    var

    m,n,t,i,j,x,y,k,sum:longint;

    s:char;

    a:array[1..2,0..101,0..101] of longint;

    begin

    readln(m,n,t);dec(t);

    for i:=1 to n do begin

    for j:=1 to m do begin

    read(s);

    if s='0' then a[1,i,j]:=0 else a[1,i,j]:=1;

    end;

    readln;

    end;

    k:=1;

    for i:=1 to t do begin

    for x:=1 to n do begin

    for y:=1 to m do begin

    sum:=0;

    for j:=1 to 8 do begin inc(sum,a[k,x+x1[j],y1[j]+y]);end;

    if a[k,x,y]=1 then begin

    if (sum=2) or (sum=3) then a[3-k,x,y]:=1 else a[3-k,x,y]:=0;

    end

    else

    begin

    if sum=3 then a[3-k,x,y]:=1 else a[3-k,x,y]:=0;

    end;

    end;

    end;

    k:=3-k;

    end;

    for x:=1 to n do begin

    for y:=1 to m do begin

    write(a[k,x,y]);

    end;

    writeln;

    end;

    end.

  • 0
    @ 2008-11-11 21:13:25

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    ms

  • 0
    @ 2008-11-11 08:54:30

    真黑啊。。。第一次一个end对错位置,20

    然后一直调都是50(WA)。。。

    最后把输出从一个过程中放到主程序中,A了。。。。。。。。。

  • 0
    @ 2008-11-09 13:10:05

    模拟...

    小心读入的是m,n,却是n行m列...

    还有,读入的是第1S的状态...

    又及:我WA了两次...

  • 0
    @ 2008-11-09 11:57:26

    program gameoflife;

    var map:array[1..64,0..101,0..101] of boolean;

    n,m,t,i,j,k:integer;

    temp:char;

    function work(t,i,j:integer):boolean;

    var ii,jj,sum:integer;

    begin

    sum:=0;

    for ii:=-1 to 1 do

    for jj:=-1 to 1 do

    if (ii0) or (jj0) then

    if map[t,i+ii,j+jj] then sum:=sum+1;

    if map[t,i,j] and ((sum=2) or (sum=3)) then exit(true);

    if not map[t,i,j] and (sum=3) then exit(true);

    exit(false);

    end;

    begin

    readln(m,n,t);

    fillchar(map,sizeof(map),false);

    for i:=1 to n do begin

    for j:=1 to m-1 do begin

    read(temp);

    if temp='1' then

    map[1,i,j]:=true;

    end;

    readln(temp);

    if temp='1' then

    map[1,i,m]:=true;

    end;

    for k:=2 to t do

    for i:=1 to n do

    for j:=1 to m do

    map[k,i,j]:=work(k-1,i,j);

    if t=1 then k:=1;

    for i:=1 to n do begin

    for j:=1 to m do

    if map[k,i,j] then write('1')

    else write('0');

    writeln;

    end;

    end.

    ---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|-

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

  • 0
    @ 2008-11-09 10:35:46

    这道题我交了n次(5

  • 0
    @ 2008-11-08 00:50:50

    怎么回事???

    int main() {

    int m,n,t,i,j,k,num;

    char cells[2][100][100];

    cin>>m>>n>>t;

    for(i=0;icells[0][i][j];

    memcpy(cells[1],cells[0],sizeof(cells[0]));

    for(i=1;i0&&cells[0][j-1][k]=='1') num++;

    if(j>0&&k0&&cells[0][j][k-1]=='1') num++;

    if(k

  • 0
    @ 2008-11-05 15:51:59

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 03:答案错误...程序输出比正确答案短

    ├ 测试数据 04:答案错误...程序输出比正确答案短

    ├ 测试数据 05:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:60 有效耗时:0ms

    哪错了?

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    可恶的N,M!竟然反着来!尽管有几题也这样,可是我这次怎么会没注意?

  • 0
    @ 2008-11-05 14:58:29

    读入的是第一秒的状态,不是第0秒

  • 0
    @ 2008-11-04 20:35:19

    #include

    #include

    #include

    #include

    #define maxm 100

    #define maxn 100

    long M,N,T,turn[9][2];

    int map[maxn+10][maxm+10],f[2][maxn+10][maxm+10];

    int got(long p,long x,long y)

    {

    long i,x2,y2,live;

    live=0;

    for(i=1;i=1 && x2=1 && y2

  • 0
    @ 2008-10-30 22:08:42

    var

    m,n,t,i,j,a,b:longint;

    xibao1,xibao2:array[0..101,0..101] of 0..1;

    xibao:array[0..101] of string;

    begin

    readln(m,n,t);

    for i:=1 to m do begin

    readln(xibao[i]);

    end;

    for i:=1 to m do begin

    for j:=1 to n do begin

    val(copy(xibao[i],j,1),xibao1);

    end;

    if t=1 then writeln(xibao[i]);

    end;

    if t=1 then exit;

    for a:=2 to t do begin

    for i:=1 to m do begin

    for j:=1 to n do begin

    if a mod 2=0 then b:=xibao1+xibao1+xibao1+xibao1+xibao1+xibao1+xibao1+xibao1;

    if a mod 2=1 then b:=xibao2+xibao2+xibao2+xibao2+xibao2+xibao2+xibao2+xibao2;

    if a mod 2=0 then if (xibao1=1) and (b=2) or (b=3) then xibao2:=1 else if (a mod 2=0) and (xibao1=1) then xibao2:=0;

    if a mod 2=1 then if (xibao2=1) and (b=2) or (b=3) then xibao1:=1 else if (a mod 2=1) and (xibao2=1) then xibao1:=0;

    if (a mod 2=0) then if (xibao1=0) and (b=3) then xibao2:=1 else if (a mod 2=0) and (xibao1=0) then xibao2:=0;

    if (a mod 2=1) then if (xibao2=0) and (b=3) then xibao1:=1 else if (a mod 2=1) and (xibao2=0) then xibao1:=0;

    end;

    end;

    end;

    for i:=1 to m do begin

    for j:=1 to n do begin

    if a mod 2=0 then write(xibao2) else write(xibao1);

    end;

    writeln;

    end;

    只有60分,哪错了?请各位大牛指教!!

  • 0
    @ 2008-10-30 18:46:29

    program p1415;

    var m,n,t,i,j,s,k,l:longint;

    a,p:array[1..100,1..100]of longint;

    c:char;

    begin

    readln(m,n,t);

    for i:=1 to m do

    begin

    for j:=1 to n do

    begin read(c); if c='0' then a:=0 else a:=1; end;

    readln;

    end;

    for s:=1 to t-1 do

    begin

    fillchar(p,sizeof(p),0);

    for i:=1 to n do

    for j:=1 to m do

    for k:=i-1 to i+1 do

    for l:=j-1 to j+1 do

    if (a[k,l]=1)and(ki)and(lj) then inc(p);

    for i:=1 to n do

    for j:=1 to m do

    if (p3)and(a=1) then a:=0;

    if (p=3)and(a=0) then a:=1;

    end;

    for i:=1 to n do

    begin

    for j:=1 to m do write(a);

    writeln;

    end;

    end.

    为什么……

  • 0
    @ 2008-10-27 19:03:49

    #include

    using namespace std;

    int N,M,T;

    int fx[9]={0,1,-1,1,-1,1,-1,0,0};

    int fy[9]={0,0,0,-1,-1,1,1,1,-1};

    int s[150][150],temp[150][150];

    int solve(int x,int y){

    int ans=0;

    for(int i=1;i>M>>N>>T;

    for(int i=1;iC;s[i][j]=C-48;}

    for(int i=1;i

  • 0
    @ 2008-10-23 22:02:59

    记住开新数组.

    严格将题目中的条件翻译过来..模拟.简单过.

  • 0
    @ 2008-10-22 14:20:49

    感谢模拟题,,,呵呵,,没几句代码就一次AC

    ,,

    Orz

  • 0
    @ 2008-10-21 21:56:18

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

  • 0
    @ 2008-10-21 19:21:29

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    终于A了,5555555555555555,readln写成read.

  • 0
    @ 2008-10-21 19:19:17

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

信息

ID
1415
难度
6
分类
模拟 点击显示
标签
(无)
递交数
1867
已通过
517
通过率
28%
被复制
2
上传者