编程介的小学生 2019-01-02 17:33 采纳率: 20.5%
浏览 346
已采纳

一个有关机器人的算法的问题,求助各位坛友,采用C语言

Problem Description
There is a robot on the origin point of an axis.Every second, the robot can move right one unit length or do nothing.If the robot is
on the right of origin point,it can also move left one unit length.A route is a series of movement. How many different routes there are
that after n seconds the robot is still located on the origin point?
The answer may be large. Please output the answer modulo 1,000,000,007

Input
There are multiple test cases. The first line of input contains an integer T(1≤T≤100) indicating the number of test cases. For each test case:

The only line contains one integer n(1≤n≤1,000,000).

Output
For each test case, output one integer.

Sample Input
3
1
2
4

Sample Output
1
2
9

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-10-04 08:06
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序