Summer Train
yuukilp
Full Of Curiosity
展开
-
UVA 12377(dfs选N个数)
觉得原创 2014-08-04 14:31:27 · 489 阅读 · 0 评论 -
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 · 930 阅读 · 0 评论 -
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 · 538 阅读 · 0 评论 -
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 · 624 阅读 · 0 评论 -
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 · 757 阅读 · 0 评论 -
zoj 3621(详解 数论)
看了几篇博文加原创 2014-07-17 00:00:47 · 882 阅读 · 0 评论