====== Efficient Printing ====== ===== 풀이 ===== * [[ps:problems:boj:1676]] 과 같은 문제. [[ps:tutorial:르장드르 공식]]을 이용해서 N!을 소인수분해했을때 5의 지수를 구하면 된다. 시간복잡도는 O(logn) ===== 코드 ===== """Solution code for "BOJ 33532. Efficient Printing". - Problem link: https://www.acmicpc.net/problem/33532 - Solution link: http://www.teferi.net/ps/problems/boj/33532 Tags: [math] """ def main(): n = int(input()) count = 0 while n := n // 5: count += n print(count) if __name__ == '__main__': main() {{tag>BOJ ps:problems:boj:실버_2}}