/ Randle /

记录详情

Time Exceeded

foo.cc: In function 'int main(int, const char**)':
foo.cc:13:35: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
     printf("%d", move(total_floor));
                  ~~~~~~~~~~~~~~~~~^
foo.cc:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &total_floor);
     ~~~~~^~~~~~~~~~~~~~~~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 0ms 256.0 KiB
#2 Time Exceeded ≥1414ms ≥256.0 KiB
#3 Time Exceeded ≥1411ms ≥256.0 KiB
#4 Time Exceeded ≥562ms ≥66.711 MiB
#5 Time Exceeded ≥581ms ≥86.723 MiB
#6 Time Exceeded ≥614ms ≥170.73 MiB
#7 Time Exceeded ≥602ms ≥103.133 MiB
#8 Time Exceeded ≥678ms ≥196.891 MiB
#9 Time Exceeded ≥606ms ≥116.352 MiB
#10 Time Exceeded ≥1072ms ≥353.281 MiB

代码

#include <stdio.h>

long long move(int floor){
    if (floor == 1) return 1;
    if (floor == 2) return 2;
    return (move(floor - 1)) % (int)(1e9+7) + (move(floor - 2)) % (int)(1e9+7);
}

int main(int argc, char const *argv[])
{
    int total_floor;
    scanf("%d", &total_floor);
    printf("%d", move(total_floor));
    return 0;
}

信息

递交者
类型
递交
题目
上楼梯(数据原创)
题目数据
下载
语言
C++
递交时间
2021-10-01 16:56:02
评测时间
2021-10-01 16:56:02
评测机
分数
10
总耗时
≥7544ms
峰值内存
≥353.281 MiB