题解

214 条题解

  • 0
    @ 2009-10-21 21:34:27

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    #include

    using namespace std;

    int main ()

    {

    int i,j,n,m,k,l;

    int a[20000][3];

    cin>>n;

    int f[20000]={0};

    for (i=1;i>a[i][1]>>a[i][2];

    for (i=1;i=a[j][2])

    k++;

    }

    f[k]++;

    }

    for(i=0;i

  • 0
    @ 2009-10-20 12:56:37

    var i,j,n,m,k,l,o,p:longint;

    a,b,c:array[0..1500] of longint;

    begin

    readln(n);

    for i:=1 to n do

    readln(a[i],b[i]);

    for i:=1 to n do

    begin

    p:=0;

    for j:=1 to n do

    if (((a[i]>=a[j])and(b[i]>b[j]))or((b[i]>=b[j])and(a[i]>a[j])))and(ij) then p:=p+1;

    c[p]:=c[p]+1;

    end;

    for i:=0 to n-1 do

    writeln(c[i]);

    end.

    哪里错了?

    可能是评测机的问题。

    大牛给看看。

  • 0
    @ 2009-10-19 13:17:05

    program p1100666;

    var x,y,s:array[1..15000]of longint;

    i,j,k,n:longint;

    begin

    readln(n);

    for i:=1 to n do

    readln(x[i],y[i]);

    fillchar(s,sizeof(s),0);

    for i:=1 to n do

    for j:=1 to n do

    if ij then

    if (x[j]

  • 0
    @ 2009-10-17 13:20:03

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    O(n^2)的算法还是慢了一点,主要是n太小没必要优化。。。

  • 0
    @ 2009-10-01 13:49:51

    这题主要是数据水

    我就说通过率怎么这么高

    正确的解法应该是 2个关键字的快排+树状数组

    全部0毫秒通过

  • 0
    @ 2009-09-26 11:57:27

    全都是p的程序,我提供个C++的吧,方便像我一样的菜鸟!牛们就不要看了!

    #include

    using namespace std;

    long long nk[15010],x[32010],y[32010],total;

    int main()

    {

    long long n, i, j;

    cin >> n;

    for(i = 1; i > x[i] >> y[i];

    for(i = 1; i = y[j])

    total++;

    }

    nk[total]++;

    }

    for(i = 0; i < n; i ++)

    cout

  • 0
    @ 2009-09-20 23:04:01

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    直接o(n^2)

  • 0
    @ 2009-09-15 16:44:23

    Program P1066;

    var x,y,f,c:array[0..15000] of integer;

    n,i,j:longint;

    Begin

    readln(n);

    for i:=1 to n do readln(x[i],y[i]);

    for i:=1 to n do

    for j:=1 to n do

    if ij then

    if (x[i]>=x[j]) and (y[i]>=y[j]) then inc(f[i]);

    for i:=1 to n do inc(c[f[i]]);

    for i:=0 to n-1 do writeln(c[i]);

    end.

  • 0
    @ 2009-09-09 18:15:45

    花了我20min DEBUG,没看见不大于...

    不用开数组存地图,简单的一维数组搞定,类似冒泡的统计。

    话说楼下有位用q_sort了,好像没必要...

  • 0
    @ 2009-08-29 19:25:47

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    water!!

  • 0
    @ 2009-08-29 09:13:51

    我用状态数组,还没看见就AC了哈

  • 0
    @ 2009-08-26 20:30:17

    无法 相信!!!

    真的没法子相信,2星最容易了的吧

    Program P1066;

    var x,y,f,c:array[0..15000] of integer;

    n,i,j:longint;

    Begin

    readln(n);

    for i:=1 to n do readln(x[i],y[i]);

    for i:=1 to n do

    for j:=1 to n do

    if ij then

    if (x[i]>=x[j]) and (y[i]>=y[j]) then inc(f[i]);

    for i:=1 to n do inc(c[f[i]]);

    for i:=0 to n-1 do writeln(c[i]);

    end.

  • 0
    @ 2009-08-22 16:27:19

    秒杀~

  • 0
    @ 2009-08-21 18:46:24

    var x,y,z:array[1..15000]of integer;i,s,j,n:integer;

    begin

    read(n);

    for i:=1 to n do read(x[i],y[i]);

    for i:=1 to n do

    for j:=1 to n do

    if (x[i]>=x[j])and(y[i]>=y[j]) then z[i]:=z[i]+1;

    for i:=0 to n-1 do

    begin

    s:=0;

    for j:=1 to n do

    if z[j]-1=i then s:=s+1;

    writeln(s);

    end;

    end.

  • 0
    @ 2009-08-19 15:14:03

    赤裸裸的搜索

  • 0
    @ 2009-08-18 20:06:30

    树状数组,秒杀

  • 0
    @ 2009-08-15 20:33:48

    O(n~2)

    沒秒殺...

  • 0
    @ 2009-08-15 16:56:56

    难得有这种水题

  • 0
    @ 2009-08-14 21:52:44

    var n,i,j:integer;

    a,b,x,y:array[0..32000] of integer;

    begin

    readln(n);

    for i:=1 to n do

    readln(x[i],y[i]);

    for i:=1 to n do

    for j:=1 to n do

    if (x[j]

信息

ID
1066
难度
4
分类
数据结构 | 树状数组数据结构 | 线段树 点击显示
标签
(无)
递交数
4662
已通过
2017
通过率
43%
被复制
9
上传者