#311. 快来写代码了
快来写代码了
Background
Special for beginners, ^_^
Description
给出下面一段程序,每次运行输入一个n,输出结果。由于结果很大,请对1e9+7取模。
#include<bits/stdc++.h>
using namespace std;
int ans, n;
void A()
{
ans++;
}
void B(int j)
{
for(int i = 0; i < j; i++)
A();
}
void L(int x, int i)
{
for(int j = i; j <= x; j++)
B(j);
}
int main()
{
cin >> n;
for(int i = 1; i <= n; i++)
L(n, i);
cout << ans;
}
Format
Input
输入每行一个n(不超过1e10)。
Output
每行输出一个对1e9+7取模后的ans。.
Samples
1
2
1
5
Limitation
1s, 1024KiB for each test case.