题解

150 条题解

  • 0
    @ 2008-12-03 22:39:11

    program c5;

    var a:longint;

    begin

    if (a mod 4=1) or (a mod 4=2) then writeln('1')

    else writeln('0');

    end.

  • 0
    @ 2008-11-30 19:46:26

    simply...

    var

    a:ansistring;

    tmp:integer;

    begin

    readln(a);

    tmp:=ord(a[length(a)])-48+(ord(a[length(a)-1])-48)*10;

    if (tmp mod 4=1)or(tmp mod 4=2) then begin writeln(1);halt;end

    else writeln(0);

    end.

  • 0
    @ 2008-11-29 17:39:13

    编译通过...

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

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

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

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

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

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

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

    只能用ansistring,不能用数组

    害我WA了N次

  • 0
    @ 2008-11-29 15:47:52

    水!

    water!

    编译通过...

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

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

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

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

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

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

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

    秒杀

    program p1141;

    var

    re:ansistring;

    a:string;

    n:longint;

    ans:longint;

    begin

    readln(re);

    n:=length(re);

    a:=copy(re,n-1,n);

    if n>=2 then

    begin

    ans:=(ord(a[1])-48)*10+(ord(a[2])-48);

    if ((ans mod 4)=1) or ((ans mod 4=2))then writeln('1')

    else writeln('0');

    end

    else

    begin

    ans:=ord(a[1])-48;

    if ((ans mod 4=1)) or ((ans mod 4=2))then writeln('1')

    else writeln('0');

    end;

    end.

    用字符串读,去后两位,如果余数为1或2输出1,否则输出0

  • 0
    @ 2008-11-21 18:45:00

    Hi

  • 0
    @ 2008-11-12 10:58:59

    都贴我也贴

    var s:ansistring;

    begin

    readln(s);

    if length(s)>=2 then

    if ((ord(s[length(s)-1])-48)*10+(ord(s[length(s)])-48)-1) mod 4

  • 0
    @ 2008-11-08 21:53:41

    第100题,虽然是条水题,不过很有纪念意义

  • 0
    @ 2008-11-06 22:04:44

    题解

  • 0
    @ 2008-11-05 17:53:13

    哈哈规律!!!!!!!!!!!!!!!!!!!!水题

    从n等于1开始

    结果是:1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 ...............

    program p1141;

    var

    len,n:integer;

    a:ansistring;

    begin

    read(a);

    len:=length(a);

    if len=1 then begin

    case a[1] of

    '0':begin writeln('0'); halt; end;

    '1':begin writeln('1'); halt; end;

    '2':begin writeln('1'); halt; end;

    '3':begin writeln('0'); halt; end;

    '4':begin writeln('0'); halt; end;

    '5':begin writeln('1'); halt; end;

    '6':begin writeln('1'); halt; end;

    '7':begin writeln('0'); halt; end;

    '8':begin writeln('0'); halt; end;

    '9':begin writeln('1'); halt; end;

    end;

    end;

    if (ord(a[len-1])-48) mod 2 =0 then begin

    case a[len] of

    '0':begin writeln('0'); halt; end;

    '1':begin writeln('1'); halt; end;

    '2':begin writeln('1'); halt; end;

    '3':begin writeln('0'); halt; end;

    '4':begin writeln('0'); halt; end;

    '5':begin writeln('1'); halt; end;

    '6':begin writeln('1'); halt; end;

    '7':begin writeln('0'); halt; end;

    '8':begin writeln('0'); halt; end;

    '9':begin writeln('1'); halt; end;

    end;

    end

    else

    case a[len] of

    '0':begin writeln('1'); halt; end;

    '1':begin writeln('0'); halt; end;

    '2':begin writeln('0'); halt; end;

    '3':begin writeln('1'); halt; end;

    '4':begin writeln('1'); halt; end;

    '5':begin writeln('0'); halt; end;

    '6':begin writeln('0'); halt; end;

    '7':begin writeln('1'); halt; end;

    '8':begin writeln('1'); halt; end;

    '9':begin writeln('0'); halt; end;

    end;

    end.

  • 0
    @ 2008-11-05 14:02:00

    if n=2 then writeln(1)

    else if n mod 4=1 then writeln(1)

    else writeln(0)

  • 0
    @ 2008-11-03 16:10:30

    program lx;

    var

    n:ansistring;

    a:array[1..2001]of integer;

    i,l,j:integer;

    begin

    readln(n);

    l:=length(n);

    for i:=1 to l do

    a[i]:=ord(n[i])-48;

    if a[l] mod 2=0 then a[l]:=a[l]-2

    else a[l]:=a[l]-1;

    for i:=1 to l do

    if a[i]

  • 0
    @ 2008-11-02 20:56:28

    超级水题!!!!!!

    大家可以找规律!

  • 0
    @ 2008-10-31 22:15:01

    白痴型水题。。。

    var

    s:ansistring;

    n:longint;

    begin

    readln(s);

    if length(s)>2 then

    val(copy(s,length(s)-1,2),n)

    else val(s,n);

    if (n*(n+1)) mod 4 = 0 then

    writeln(0) else writeln(1);

    end.

  • 0
    @ 2008-10-30 20:37:13

    编译通过...

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

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

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

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

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

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

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

    要用ansistring啊!!

    我wa了3次,我的AC率啊!55555555555555555555

  • 0
    @ 2008-10-28 20:12:23

    题目描述太该死了!!!哪里有那么多位??

    规律怎么证明的啊???????

    哪位大牛写的详细点好吗,看不懂啊

  • 0
    @ 2008-10-27 22:13:27

    编译通过...

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

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

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

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

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

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

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

    庆祝一星!!

  • 0
    @ 2008-10-20 13:16:59

    Flag   Accepted

    题号   P1141

    类型(?)   数论 / 数值

    通过   2140人

    提交   6484次

    通过率   33%

    难度   1

  • 0
    @ 2008-10-11 17:27:01

    #include

    #include

    using namespace std;

    main ()

    {

    char a[2003];

    int n;

    cin>>a;

    if (strlen (a)==1)

    n=a[0]-'0';

    else n=(a[strlen (a)-2]-'0')*10+(a[strlen (a)-1]-'0');

    n%=4;

    if (n==1 || n==2)

    cout

  • 0
    @ 2008-10-06 18:51:28

    program feifu;

    var

    str:ansistring;

    i,j,code:longint;

    begin

    readln(str); str:='00'+str; i:=length(str);

    val(copy(str,i-1,2),j,code);

    if (j mod 4=1) or (j mod 4=2) then writeln('1')

    else writeln('0');

    end.

  • 0
    @ 2009-07-06 20:47:52

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

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

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

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

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

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

    这是lk出的水题,Orz一下

信息

ID
1141
难度
5
分类
高精度 | 其他 点击显示
标签
(无)
递交数
4256
已通过
1415
通过率
33%
被复制
12
上传者