Subscribed unsubscribe Subscribe Subscribe

0w1

CFR 525 E. Anya and Cubes ( Search )

Problem - E - Codeforces題意: 給 N 個數字的數列 A[]。你可以選至多 K 個數字,將它們變成自己的階乘,這個操作對同一個元素只能使用一次。問有幾種方法可以得到一個子集合,其總和恰為 S。兩種方法相同若且唯若集合相同且施加的操作相同。資料規模: The…

CFR 285 D. Permutation Sum ( Meet in the Middle, Search )

Problem - D - Codeforces題意: 問有多少 A, B, C 數列的組合,使得 ( A[ i ] + B[ i ] ) % N = C[ i ],且 A, B, C 都是 [ 0, N ) 的排列。資料規模: The single line contains integer n (1 ≤ n ≤ 16). TL: 1500 ms ML: 256 MB解法: 有用到這題的結論,…

IOICJ 57 LCM Problem ( Math, Search )

Problem Description: Given N, you want to know max{ LCM(x,y,z), 1≤x,y,z≤N }.Constraints: 1≤T≤1000 1≤n≤1e6Sample Input: 3 7 9 100Sample Output: 210 504 960300Solution: It is obvious that we would like some of the largest x, y, z, such that …