v***a 发帖数: 365 | 1 Define:
C[i]: Total different number of blocks when height_1 weight_i. Including non
-solid structure. Like Fibonacci, number:
C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4]
B[i]: Total different number of blocks when height_N weight_i. Including non
-solid structure. Please use the O(LogN) method to calculate power:
B[i] = power( C[i], N )
A[i]: Total different number of blocks when height_N weight_i. Only SOLID
structure.
A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))
A[M] is the answer.
tips:
1) use (...) % Mod everywhere.
2) use int64 or long long, because you need to use multiple.
很不好意思,突然发现这是个烙印的startup,所以如果他知道你不是印度人的话,有
些……都懂得
但是大家自己可以去公司的网站自己apply,把成绩贴上去
团结,被烙印欺负了,不还手就有些不爽了! | q****x 发帖数: 7404 | 2 看不懂题目。
non
non
【在 v***a 的大作中提到】 : Define: : C[i]: Total different number of blocks when height_1 weight_i. Including non : -solid structure. Like Fibonacci, number: : C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4] : B[i]: Total different number of blocks when height_N weight_i. Including non : -solid structure. Please use the O(LogN) method to calculate power: : B[i] = power( C[i], N ) : A[i]: Total different number of blocks when height_N weight_i. Only SOLID : structure. : A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))
| q***p 发帖数: 16 | 3 谢谢viisa这么认真写报告来帮助找不到思路的朋友~
我第一次用O(N)的球Power也过了。但O(LogN)的二分求法确实快不少。
non
non
【在 v***a 的大作中提到】 : Define: : C[i]: Total different number of blocks when height_1 weight_i. Including non : -solid structure. Like Fibonacci, number: : C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4] : B[i]: Total different number of blocks when height_N weight_i. Including non : -solid structure. Please use the O(LogN) method to calculate power: : B[i] = power( C[i], N ) : A[i]: Total different number of blocks when height_N weight_i. Only SOLID : structure. : A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))
| l***i 发帖数: 1309 | 4 If you look at the leader board, most top 10 are from China. |
|