- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 Light OJ 1165 Digit Dancing
1165 - Digit Dancing Digits like to dance. One day, 1, 2, 3, 4, 5, 6, 7 and 8stand in a line to have a wonderful party. Each time, a male digit can ask afemale digit to dance with him, or a female d
2014-08-22 22:42:26 1123
转载 博弈问题的初步学习
例子: 甲乙两人面对若干堆石子,其中每一堆石子的数目可以任意确定。例如图1所示的初始局面:共n=3堆,其中第一堆的石子数a1=3,第二堆石子数a2=3,第三堆石子数a3=1。两人轮流按下列规则取走一些石子,游戏的规则如下: 每一步应取走至少一枚石子; 每一步只能从某一堆中取走部分或全部石子; 如果谁无法按规则取子,谁就是输家。
2014-08-20 23:10:15 725
转载 UVALive 5964 LCM Extreme(数论 欧拉函数)
/* 2 题目大意:求lcm(1,2)+lcm(1,3)+lcm(2,3)+....+lcm(1,n)+....+lcm(n-2,n)+lcm(n-1,n) 3 设sum(n)为sum(lcm(i,j))(1<=i<j<=n)之间最小公倍数的和,f(n)为sum(i*n/gcd(i,n))(1<=i<n) 4 那么sum(n)=sum(n-1)+f(n)。可以用线性欧拉筛选+递推来做。 *
2014-08-04 17:48:34 920
原创 UVALive 5968 Blade and Sword(搜索)
1) '.' represents an empty space. The player can move through it. 2) '#' represents wall, and the player cannot move through it. You can assume that the boundaries of the grid will
2014-08-04 15:42:46 747
转载 UVAlive 5971 Permutation Counting(数论 dp)
Permutation Counting Dexter considers a permutation of first N natural numbers good if it doesn't have x and x+1 appearing cons ecutively, where (1 ≤ x 1.{1, 3, 2} 2.{2, 1, 3} 3.{3, 2, 1} Input
2014-08-04 15:27:35 529
原创 ZOJ 2972(背包dp)
#include #include #include using namespace std; const int INF=1e9; int dp[120][120]; int t1[120],t2[120],t3[120],f1[120],f3[120]; int main() { int n,T,i,j,m; cin>>T; while(T--) {
2014-08-04 15:04:43 614
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人