07 2020 档案
摘要:https://www.luogu.com.cn/problem/P1083 ac代码: #include<iostream> #include<cstring> using namespace std; const int maxn=1e6+5; int n,m; int room[maxn],d
阅读全文
摘要:思路: 用二维前缀统计每个像素对该点的贡献,对二维前缀进行维护,删除重复值 AC代码 #include <iostream> #define ll long long using namespace std; ll a,b,n,m,Max=0; bool img[3845][2165]; int d
阅读全文
摘要:题目大意: 给出一段只含序列'0'和'1'的序列,形成一个圆环,以及时间M,每结果1单位时间,如果a[i-1]==1(当i==0时,i-1为n-1),则a[i]^=1; 求M时间后的序列 中间有一段写错了,搜了博客才知道原来是对2取模,我理解成不是1就是0 AC代码: #include<iostre
阅读全文
摘要:Matrix Power Series Description Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak. Input The input contains exact
阅读全文
摘要:M斐波那契数列 Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = aF[1] = bF[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗? Input 输入包含多组测试数据;每组数据占一
阅读全文
摘要:比赛连接https://acm.ecnu.edu.cn/contest/292/problem/E/ E. 因数串 相邻两位相差一个质因子,即相邻两位有且仅有一个质因子的幂次相差1,其余质因子个的幂次相等。 采用类似格雷码的方式构造即可 #include<iostream> #include<alg
阅读全文
摘要:①递归实现 #include<iostream> #include<cstring> #define ll long long using namespace std; int dp[15][10],digit[15]; void init(){ memset(dp,0,sizeof(dp)); d
阅读全文