题解

129 条题解

  • 0
    @ 2008-10-20 19:58:34

    var

    yy,mm,dd:longint;

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

    procedure zao;

    begin

    case mm of

    1,3,5,7,8,10,12 :j:=31;

    4,6,9,11 :j:=30;

    2 :if (((yy mod 400)0)and(yy mod 4=0))or(yy mod 400=0)

    then j:=29

    else j:=28;

    end;

    end;

    begin

    readln(yy,mm,dd);

    for i:=1 to 10000 do

    begin

    zao;

    if ddj

    then inc(dd)

    else begin

    dd:=1;

    inc(mm);

    if mm=13

    then begin

    mm:=1;

    inc(yy);

    end;

    end;

    end;

    write(yy,'-',mm,'-',dd);

    end.

  • 0
    @ 2008-10-11 09:14:12

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var

    yy,mm,dd,i:word;

    v:boolean;

    begin

    readln(yy,mm,dd);

    for i:=1 to 10000 do

    begin

    v:=true;

    if v and (mm=12) and (dd=31) then begin inc(yy); mm:=1; dd:=1; v:=false; end;

    if v and ((mm=1) or (mm=3) or (mm=5) or (mm=7) or (mm=8) or (mm=10)) and (dd=31) then begin inc(mm); dd:=1; v:=false; end;

    if v and ((mm=1) or (mm=3) or (mm=5) or (mm=7) or (mm=8) or (mm=10) or (mm=12)) and (dd

  • 0
    @ 2008-10-03 21:09:36

    搜索万能!!!!

    (for i:=1 to 10000 do

    begin

    ....

    end;

    writeln(y,m,d);)===========AC AC AC AC

  • 0
    @ 2008-10-02 20:35:51

    这题我居然交了3次……第一次有错,改完了提交的时候发现验证码(按“提交”前,自己看出来的)还是原来那个,就F5了一下,直接交上去了(实际上还是原来那个……郁闷………)

    //推论:发现验证码有问题时,哪怕和之前的一样,也直接打,等它提示出错了再改。

  • 0
    @ 2008-09-30 16:14:40

    编译通过...

    ├ 测试数据 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-09-30 15:38:56

    纯粹打字,乱写92行,不敢说了!

  • 0
    @ 2008-09-30 13:16:12

    ├ 测试数据 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-09-29 11:37:26

    算法还是朴素些好

  • 0
    @ 2008-09-24 12:01:26

    #include

    int main(){

    int y,m,d,i;

    scanf("%d%d%d",&y,&m,&d);

    for (i=1;i

  • 0
    @ 2008-09-23 20:19:07

    {main}

    begin

    read(y,m,d);

    s:=10000;

    while s0 do

    begin

    dec(s);

    inc(d);

    if not (r(y)) and (d>a1[m]) then

    begin

    d:=1;

    inc(m);

    end

    else if r(y) and (d>a2[m]) then

    begin

    d:=1;

    inc(m);

    end;

    if m=13 then begin m:=1;inc(y); end;

    end;

    WHY!WHY SO E..A..S..y!

  • 0
    @ 2008-09-14 13:23:00

    疯狂的判断~~~~疯狂的题目~~~~~~~~~送分

  • 0
    @ 2008-09-08 20:37:24

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    本人来个C的:

    #include

    #include

    int main()

    {

    int n,y,r,i;

    scanf("%d%d%d",&n,&y,&r);

    for(i=1;i

  • 0
    @ 2008-09-08 20:28:55

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    苍天哪!!!我一个同样的程序提交了两遍,居然第一次编译未通过,第二次才AC。。。

  • 0
    @ 2008-09-01 17:55:12

    重申一下闰年的定义供大家参考

    含义:闰年是为了弥补因人为历法规定造成的年度天数与地球实际公转周期的时间差而设立的。补上时间差的年份,即有闰日的年份为闰年

    公历闰年判定遵循的规律为: 四年一闰,百年不闰,四百年再闰.

    公历闰年的简单计算方法(符合以下条件之一的年份即为闰年)

    1。能被4整除而不能被100整除。

    2。能被400整除。

    (摘自百度百科-闰年词条)

    编译通过...

    ├ 测试数据 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-08-31 21:12:29

    模拟。。

    3次ac。。。。2次语法错误。

  • 0
    @ 2008-08-31 18:20:33

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    //---|---|---|---|---|---|---|---|---|---|---|--

    const

    mon1:array[1..12]of byte=(31,28,31,30,31,30,31,31,30,31,30,31);

    mon2:array[1..12]of byte=(31,29,31,30,31,30,31,31,30,31,30,31);

    var

    y,m,d,total:integer;

    function check(x:integer):boolean;

    begin

    if x mod 4=0 then exit(true);

    exit(false);

    end;

    begin

    read(y,m,d);

    inc(y,24);

    total:=1234;

    while total0 do begin

    dec(total);

    inc(d);

    if (d>31)and check(y) then begin

    dec(d,mon2[m]);

    inc(m);

    if m=13 then begin

    m:=1;

    inc(y);

    end;

    end;

    if (d>31)and not(check(y)) then begin

    dec(d,mon1[m]);

    inc(m);

    if m=13 then begin

    m:=1;

    inc(y);

    end;

    end;

    end;

    if (d>=31)and((m=4)or(m=6)or(m=9)or(m=11)) then begin

    inc(m);

    dec(d,30);

    end;

    if m=2 then begin

    if (d>28)and not(check(y)) then begin

    dec(d,28);

    inc(m);

    end;

    if (d>29)and check(y) then begin

    dec(d,29);

    inc(m);

    end;

    end;

    write(y,'-',m,'-',d);

    end.

    直接模拟

  • 0
    @ 2008-08-28 20:51:29

    奇怪了

    我把夸克的程序弄到自己的pascal上能运行起

    但提交就有错

  • 0
    @ 2008-08-26 21:37:53

    编译通过...

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

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

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

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

     ├ 错误行输出

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

     ├ 错误行输出

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

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

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

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

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

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

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

    楼下的有错啊

  • 0
    @ 2008-08-23 14:30:55

    var

    y,m,d,i,x:integer;

    begin

    read(y,m,d);

    while i10000

    then begin m:=m-1; d:=d+10000-x; end;

    case m of

    1,3,5,7,8,10,12:if d>31

            then begin m:=m+1; d:=d-31; end;

    4,6,9,11:if d>30

         then begin m:=m+1; d:=d-30; end;

    2:if ((y mod 4=0)and(y mod 1000))or(y mod 400=0)

    then if d>29

       then begin m:=m+1; d:=d-29; end

    else if d>28

       then begin m:=m+1; d:=d-28; end;

       end;

    if m>12

    then begin y:=y+1; m:=m-12; end;

    x:=i;

    end;

    write(y,'-',m,'-',d);

    end.

  • 0
    @ 2008-10-06 12:53:16

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    Flag   Accepted

    题号   P1211

    类型   其它

    通过   1810人

    提交   3714次

    通过率   49%

    难度   1

    第1810个AC的!!!!!!!!!!!!

    闰年判断很重要.

信息

ID
1211
难度
3
分类
模拟 点击显示
标签
(无)
递交数
2740
已通过
1333
通过率
49%
被复制
16
上传者