A题。发现是递推可以解决这道题,a[n]=6*a[n-1]-a[n-2]。因为是求和,可以通过一个三维矩阵加速整个计算过程,主要是预处理出2^k时的矩阵,可以通过这道题 1 #include 2 #include 3 #include 4 #include 5 #define LL long...
分类:
其他好文 时间:
2015-10-16 20:50:48
阅读次数:
315
POJ题目分类| POJ题目分类 |HDU题目分类|ZOJ题目分类|SOJ题目分类|HOJ题目分类|FOJ题目分类|模拟题:POJ1006POJ1008POJ1013POJ1016POJ1017POJ1169POJ1298POJ1326POJ1350POJ1363POJ1676POJ1786POJ1...
分类:
其他好文 时间:
2015-10-14 21:37:32
阅读次数:
413
题目重述: 问题描述 要求找出具有下列性质数的个数(包含输入的自然数n): 先输入一个自然数n(n<=1000),然后对此自然数按照如下方法进行处理: 1. 不作任何处理; 2. 在它的左边加上一个自然数,但该自然数不能超...
分类:
其他好文 时间:
2015-10-09 14:02:12
阅读次数:
168
二分答案+验证#include#include#include#includeusing namespace std;int N,M,K,A;int p[200000+10],a[200000+10];int Num(int B,int A){ return (B+1)/(A+1);}int ...
分类:
其他好文 时间:
2015-10-06 20:42:12
阅读次数:
149
#include#includeusing namespace std;int a[8000]={2,3};int hash[80000]={0};void func(){ int i,j,k=2,flag; hash[2]=hash[3]=1; for(i=5;k=a[j];j+...
分类:
其他好文 时间:
2015-09-09 16:50:14
阅读次数:
156
Problem 2075 Substring
Accept: 70 Submit: 236
Time Limit: 1000 mSec Memory Limit : 65536 KB
Problem Description
Given a string, find a substring of it which the original string conta...
分类:
编程语言 时间:
2015-08-27 23:07:16
阅读次数:
1156
Problem 2082 过路费
Accept: 382 Submit: 1279
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
有n座城市,由n-1条路相连通,使得任意两座城市之间可达。每条路有过路费,要交过路费才能通过。每条路的过路费经常会更新,现问你,当前情况下,从城市a...
分类:
其他好文 时间:
2015-08-17 19:35:50
阅读次数:
113
Problem 2020 组合Accept: 714Submit: 1724Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数。例如C(5,2) = 10, C(...
分类:
其他好文 时间:
2015-08-12 08:59:56
阅读次数:
122
题目链接:http://acm.fzu.edu.cn/problem.php?pid=1075
思路:分解素因子#include
#include
#include
using namespace std;
const int maxn=65535+5;
typedef long long LL;
bool prime[maxn];
in...
分类:
其他好文 时间:
2015-08-01 15:46:21
阅读次数:
112
N (1 i (1 i
Each monkey is looking to his left toward those with higher index numbers. We say that monkey i "looks up" to monkey j if i ij. For each monkey i, we would like to know the index of th...
分类:
其他好文 时间:
2015-07-06 21:50:51
阅读次数:
153