题解

151 条题解

  • 0
    @ 2009-03-06 23:24:38

    #include

    using namespace std;

    int main()

    {

    int n,i=0;

    cin>>n;

    while(n-i>1)

    n-=++i;

    if(i%2==1)cout

  • 0
    @ 2009-02-27 13:25:25

    program p1333;

    var

    n,tot:longint;

    x,y:integer;

    begin

    read(n);

    tot:=0;x:=1;y:=1;

    repeat

    tot:=tot+x;

    inc(x);

    until tot>=n;

    dec(x);

    //write(x);

    tot:=tot-x;

    y:=n-tot;

    if x mod 2 =0

    then write(y,'/',x-y+1)

    else write(x-y+1,'/',y);

    end.

  • 0
    @ 2009-02-25 16:06:21

    #include

    int main()

    {

    int m,n,r;

    scanf("%d",&n);

    r=n;

    m=1;

    while(1)

    {

    if((r-(m+1))

  • 0
    @ 2009-02-22 15:30:52

    水啊~

    program p1333;

    var a,b,i:longint;

    begin

    read(a);

    b:=1;

    i:=1;

    while i

  • 0
    @ 2009-02-21 23:08:17

    我靠一道水题过了半天还刷通过率。。。

    这个Z字形其实是

    1 2 6 7

    3 5 8

    4 9

    10

    而被我理解成

    1 2 4 7

    3 5 8

    6 9

    10

    而且样例7正好是两种方法都在同个位置上的,所以查了半天。。。

    来过水题的同志们不要理解错了。。。

    编译通过...

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

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

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

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

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

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

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

  • 0
    @ 2009-02-07 22:40:00

    穷举不是万能的,但没有穷举却是万万不能的!

  • 0
    @ 2009-02-07 21:08:52

    大家一起来鄙视我吧!

    附:我的题解

    #include "stdio.h"

    main()

    { long n,s=0,s1=0,a,b,t;

    int i,j,k;

    scanf("%d",&n);

    for(i=1;;i++)

    { s+=i;

    if(s>=n)

    break;

    }

    if(i%2==0)

    {for(k=1;k

  • 0
    @ 2009-01-31 13:40:41

    扫水使自己AC率下降2个百分点 囧TZ

  • 0
    @ 2009-01-19 16:21:06

    var i,n,j,a:longint;

    begin

    readln(n);

    a:=1;

    i:=1;

    while i

  • 0
    @ 2009-01-15 15:37:40

    编译通过...

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

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

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

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

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

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

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

  • 0
    @ 2009-01-13 11:19:30

    var i,n,j,a:longint;

    begin

    readln(n);

    a:=1;

    i:=1;

    while i

  • 0
    @ 2008-12-07 13:52:20

    program cantor;

    var

     n,i,s,d:longint;

    begin

      readln(n);

      i:=1;s:=0;

      while n>s do

       begin

        s:=s+i;

        inc(i);

       end;

      dec(i);s:=s-i;

      d:=n-s;

      if d>0 then

       if odd(i+1) then write(d,'/',i+1-d) else write(i+1-d,'/',d)

       else

        if odd(i) then write(d+1,'/',i-d) else write(i-d,'/',d+1);

    end.

  • 0
    @ 2008-11-11 12:14:00
  • 0
    @ 2008-11-07 19:14:40

    program cantor;

    var

    n,i,s,d:longint;

    begin

    readln(n);

    i:=1;s:=0;

    while n>s do

    begin

    s:=s+i;

    inc(i);

    end;

    dec(i);s:=s-i;

    d:=n-s;

    if d>0 then

    if odd(i+1) then write(d,'/',i+1-d) else write(i+1-d,'/',d)

    else

    if odd(i) then write(d+1,'/',i-d) else write(i-d,'/',d+1);

    end.

  • 0
    @ 2008-11-07 10:38:24

    很水的题,但是交了两遍。刚开始没看懂Z字型是什么意思。。。

  • 0
    @ 2008-10-31 19:31:46

    我只能说数据太弱了,我写的是递推,结果中间处理做了……第一次还过了4个点,只是第一个没过。

  • 0
    @ 2008-10-29 17:49:32

    很神奇...

  • 0
    @ 2008-10-27 14:22:51

    我神经病..做这题...

    模拟直接过..程序超15行就对不起自己了.

  • 0
    @ 2008-10-23 21:53:06

    倒~

    咱用流输入输出硬算错~~

    人性啊~~~~没人性啊~~~~~

    咱的AC率直线下跌

  • 0
    @ 2008-10-14 20:21:59

    编译通过...

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

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

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

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

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

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

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

    水题不扫,何以扫天下?——某大牛

信息

ID
1333
难度
3
分类
数论 点击显示
标签
递交数
3681
已通过
1959
通过率
53%
被复制
20
上传者