您的位置:首页 > 产品设计 > UI/UE

排列组合:poj 1019 Number Sequence

2015-02-05 15:08 309 查看
比较简单的一道数学问题,关键在于要有自己的思路和代码实现,注意多位数会占多个空间(长度)。

题目链接:http://poj.org/problem?id=1019

参考题解:

(1)小優YoUhttp://blog.csdn.net/lyy289065406/article/details/6648504

(2)kuangbi: http://www.cnblogs.com/kuangbin/archive/2011/07/21/2113279.html
(3)ACShiryu's
Blog:
 http://www.cnblogs.com/ACShiryu/archive/2011/08/05/2129009.html

参考代码+部分解释:

#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int maxn = 7e4+10;
int a[maxn];
void init()
{
a[1]=1;
for(int i=2;i=temp) break;
}
for(int j=ans-temp;j>0;j--) i/=10;//得到temp指向的那个位置
return i%10;
}
int main()
{
// freopen("input.txt","r",stdin);
init();
int T;cin>>T;
while(T--){
int n;cin>>n;
cout<
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  排列组合