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)提供评测服务
代码
#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;
}