#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=105; const int mod=1e9+7; int n; struct matrix { ll a[maxn][maxn]; m ...
分类:
其他好文 时间:
2020-07-18 22:14:26
阅读次数:
75
N children are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it i ...
分类:
其他好文 时间:
2020-07-18 00:42:12
阅读次数:
76
http://poj.org/problem?id=2406 http://poj.org/problem?id=1961 几乎是一个题 1961是对于第 \(i\) 位,求 \([1,i]\) 能不能由一段字符循环一次以上组成,输出 \(i\) 和这样的长度最小的循环节循环次数 2406是只对第 ...
分类:
其他好文 时间:
2020-07-17 13:49:40
阅读次数:
47
Running Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8597 Accepted: 3213 Description The cows are trying to become better athletes, so B ...
分类:
其他好文 时间:
2020-07-16 18:10:43
阅读次数:
60
problem 1380. Lucky Numbers in a Matrix 在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。 Constraints All elements in the matrix are distinct. so ...
分类:
其他好文 时间:
2020-07-16 00:15:33
阅读次数:
72
重新做了一下这道并查集的题目,关键要点是抓住这种循环的关系和模运算的通性,进而利用加权并查集 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; cons ...
分类:
其他好文 时间:
2020-07-15 23:39:09
阅读次数:
63
题目链接:http://poj.org/problem?id=2482 给出每个点框定的区域,求区域叠加的最大值,可以通过如下算法: 将每个可行点都标记,记录这些点上的权值,维护一个叶结点是一个权值点的线段树,更新的时候注意,由于所有的点都是可行点,所以右边界要在最后删除,遇到同样的x坐标的,优先叠 ...
分类:
编程语言 时间:
2020-07-15 15:23:49
阅读次数:
68
斐波那契数列 起源 兔子问题:“假定一对大兔子每月能生一对小兔子,且每对新生的小兔子经过一个月可以长成一对大兔子,具备繁殖能力,如果不发生死亡,且每次均生下一雌一雄,问一年后共有多少对兔子?” 分析:第一个月兔子没有繁殖能力,所以还是一对;两个月后生下一对兔子,共有两对;三个月后,老兔子生下一对,小 ...
分类:
其他好文 时间:
2020-07-13 11:26:20
阅读次数:
95
列一下hdu,poj,CF上常见的Stirling数相关的习题(补充完善中): hdu2643 hdu3625 hdu4372 hdu4045 POJ1430 POJ2621 CF932E CF961G CF960G ...
分类:
其他好文 时间:
2020-07-12 16:52:18
阅读次数:
64
##题面 Problem Description Lele now is thinking about a simple function f(x). If x < 10 f(x) = x. If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x ...
分类:
其他好文 时间:
2020-07-12 16:40:31
阅读次数:
59