This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Problem: | |
| How to Convert PDF to Image with Python Script ? | |
| Installation: | |
| I use ubuntu OS 14.04 | |
| We use wrapper for ImageMagick [http://www.imagemagick.org/script/index.php] to Convert The PDF file | |
| in Python do: | |
| $ sudo apt-get install libmagickwand-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import lru_cache | |
| class Solution: | |
| def maxNiceDivisors(self, primeFactors): | |
| res = 1 | |
| for num_pieces in range(1, primeFactors // 2 + 1): | |
| if primeFactors % num_pieces == 0: | |
| each_piece_cnt = primeFactors // num_pieces | |
| # 均值定理 | |
| res = max(res, each_piece_cnt ** num_pieces) |