2016年2月23日

codeforces 616E. Sum of Remainders 数学

摘要: 题目链接 给两个数n, m. 求n%1+n%2+.......+n%m的值。 首先, n%i = n-n/i*i, 那么原式转化为n*m-sigma(i:1 to m)(n/i*i)。 然后我们可以发现 1/4 = 2/4 = 3/4 = 0, 4/4 = 5/4 = 6/4 = 7/4 = 1. 阅读全文

posted @ 2016-02-23 20:23 yohaha 阅读(293) 评论(0) 推荐(0)

codeforces 620F. Xors on Segments

摘要: 题目链接 定义一种操作f(u, v) = u^u+1^.......^v。 (u<=v), 给n个数, q个询问, 每个询问给出一个区间[l, r], 求这个区间里的f(a[i], a[j]) (l<=i<=j<=r)的最大值。 一开始竟然用n^2m的方法, 真是有点脑残.. #include <i 阅读全文

posted @ 2016-02-23 15:40 yohaha 阅读(518) 评论(0) 推荐(0)

codeforces 417D. Cunning Gena 状压dp

摘要: 题目链接 D. Cunning Gena time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A boy named Gena rea 阅读全文

posted @ 2016-02-23 09:26 yohaha 阅读(260) 评论(0) 推荐(0)

导航