摘要: 解法参考:http://blog.csdn.net/a601025382s/article/details/9840125#include #include #include #include using namespace std;#define LL long long intconst int MAXN = 1000010;const LL MOD = (1e9) + 7;int n;LL a[MAXN];LL b[MAXN];void ExGcd( LL a, LL b, LL& d, LL& x, LL& y ){ if ( !b ) { d = a, x = 阅读全文
posted @ 2013-08-09 17:11 冰鸮 阅读(274) 评论(0) 推荐(0)
摘要: 显然正着倒着看仍然是数字的只有7个数:0,1,2,5,6,8,9所以就是用这7个数组合成不同的数。将n转换成7进制,对应位输出即可。#include #include #include #include using namespace std;const char num[] = "0125986";const int MAXN = 1010;const int BASE = 7;char str[MAXN];int a[MAXN];int b[MAXN];int ans[MAXN];int cnt, len;bool check(){ for ( int i = 0; i 阅读全文
posted @ 2013-08-09 16:27 冰鸮 阅读(310) 评论(0) 推荐(0)
摘要: 跟矩阵链乘同类型的题……输出用%llu不是%I64u……几组数据:141+2*4+3*4+5*00*5*6+7*3+23+0+6+7+0+44*5+7*1*1+12*0+3*4*0+5*6+7+81+2+3*1+2*1+00+2*2+3*0+48*9*0+22*0+1+0*32*0*3+7+1*0*31+3*0*5+21+1+1+1+12*1+1+2*1+2*1+61*2*4*0*6*3#include #include #include #include #include #define LL unsigned long long intusing namespace std;const i 阅读全文
posted @ 2013-08-09 15:02 冰鸮 阅读(398) 评论(0) 推荐(0)