两个点!!!

评测结果
编译成功

测试数据 #0: Accepted, time = 0 ms, mem = 1288 KiB, score = 10
测试数据 #1: WrongAnswer, time = 15 ms, mem = 1296 KiB, score = 0
测试数据 #2: Accepted, time = 15 ms, mem = 1292 KiB, score = 10
测试数据 #3: Accepted, time = 46 ms, mem = 1300 KiB, score = 10
测试数据 #4: Accepted, time = 125 ms, mem = 1304 KiB, score = 10
测试数据 #5: Accepted, time = 281 ms, mem = 1300 KiB, score = 10
测试数据 #6: WrongAnswer, time = 375 ms, mem = 1304 KiB, score = 0
测试数据 #7: Accepted, time = 421 ms, mem = 1300 KiB, score = 10
测试数据 #8: Accepted, time = 640 ms, mem = 1304 KiB, score = 10
测试数据 #9: Accepted, time = 906 ms, mem = 1304 KiB, score = 10
WrongAnswer, time = 2824 ms, mem = 1304 KiB, score = 80
代码
#include<stdio.h>

int main()
{
  int i,j,c[200000],d[10000]={0},m,n,a,b;
  scanf("%d\n",&n);
  for(i=0;i<=n-1;i++)
    scanf("%d",(c+i));
  scanf("%d\n",&m);
  for(i=0;i<=m-1;i++)
  {
    scanf("%d %d",&a,&b);
    for(j=a-1;j<=b-1;j++)
      if(c[j]>d[i])  d[i]=c[j];
  }
  for(i=0;i<=m-1;i++)
    printf("%d\n",*(d+i));
  return 0;
}

1 条评论

  • 1

信息

ID
1514
难度
6
分类
其他 | RMQ 点击显示
标签
(无)
递交数
4994
已通过
1205
通过率
24%
被复制
3
上传者