题目 vjudge URL:Counting Divisors (square) Let σ0(n)\sigma_0(n)σ0(n) be the number of positive divisors of nnn. For example, σ0(1)=1\sigma_0(1) = 1σ0(1)=1, σ0(2)=2\sigma_0(2) = 2σ0(2)=2 and σ0(6)=4\sigma_0(6) = 4σ0(6)=4. Let S2(n)=∑i=1nσ0(i2).S_2(n…
dalao教导我们,看到计数想容斥……卡常策略:枚举顺序.除去无效状态.(树结构) #include <cstdio> #include <cstring> #include <algorithm> typedef long long LL; ; LL f[N][N]; int n,m,d[N][N],full; bool yeah[N]; int st[N],cnt; struct V{ int to,next; }c[N<<]; int head[N],…
C. Mike and Foam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is a bartender at Rico's bar. At Rico's, they put beer glasses in a special shelf. There are n kinds of beer at Rico's…
题目 Source http://acm.hust.edu.cn/vjudge/problem/42145 Description Let’s assume there is a new chess piece named Super-rook. When placed at a cell of a chessboard, it attacks all the cells that belong to the same row or same column. Additionally it at…