/ SB域 /

记录详情

Time Exceeded


  
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Time Exceeded ≥1040ms ≥5.398 MiB
#2 Time Exceeded ≥1023ms ≥5.402 MiB
#3 Time Exceeded ≥1065ms ≥5.246 MiB
#4 Time Exceeded ≥1076ms ≥5.41 MiB
#5 Time Exceeded ≥1059ms ≥5.668 MiB
#6 Time Exceeded ≥1046ms ≥5.316 MiB
#7 Time Exceeded ≥1100ms ≥5.438 MiB
#8 Time Exceeded ≥1009ms ≥5.457 MiB
#9 Time Exceeded ≥1037ms ≥5.414 MiB
#10 Time Exceeded ≥1051ms ≥5.418 MiB

代码

#include<stdio.h> 
int A[500005];
int table[3500000]={0};
void init()
{
      int i,t;
      A[0]=0;
      for(i=1;i<=500000;i++)
      {
            t=A[i-1]-i;
            if(t>0&&!table[t])
                  A[i]=t;
            else
                  A[i]=A[i-1]+i;
            table[A[i]]=1;
      }
}
int main()
{
      int n;
      init();
      while(scanf("%d",&n)&&n!=-1)
      {
            printf("%d",A[n]);
      }
      return 0;
}
 

信息

递交者
类型
递交
题目
雷卡曼序列
题目数据
下载
语言
C
递交时间
2022-01-14 16:16:03
评测时间
2022-01-14 16:16:03
评测机
分数
0
总耗时
≥10509ms
峰值内存
≥5.668 MiB