Analog 84

T1

  I find that I fucks A lot of the problem. . .

  First, we can find the answer with the k is explosive growth, then you may want to place a legitimate number within 1e18 whole process out (search), the actual operation, you will find the B <10 is when you can do so, but B 1e18 within a few too many big time, not all screened out.

  Then find k <1e7, we can think of half the answer, you can do $ O (klog1e18) $, but the complex is too high, can not afford.

  After about an hour later, suddenly thought, is not concerned over the number of 1e7, 1e7 number as long as you can handle it, then manually determine the upper bound of half the answer, to $ O (10000000) $ process. All data run as fast, so the total time is very slow. . .

T2

  Got 84pts on the test, after the test has been optimized to increase the AC.

  Defined state $ f_ {s} $ represents a scheme for the state s of time. Wherein s is a ternary number, the i-th bit represents the quality factor is the number of factors set to i.

  Direct memory can search, note that we are not concerned about the number of each factor, it is only concerned with the set of prime factors, then the state transition from $ O (d (n)) $ reduced to $ O (2 ^ {prime factors of a number}) $, then you can the AC.

  O theoretical number of states $ (. 3 ^ 2 ^ {} {}. 6) $ (this number is approximately $ 10 $ ^ {30}) , but only the actual data limit 20w +, can pass.

T3

  Randomized NB, given too little time on the test.

 

Guess you like

Origin www.cnblogs.com/hzoi-cbx/p/11729170.html