結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
|
提出日時 | 2020-08-22 15:05:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 37 ms / 1,000 ms |
コード長 | 867 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-10-15 09:23:11 |
合計ジャッジ時間 | 2,621 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
import sysimport refrom collections import deque, defaultdict, Counterfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcdfrom itertools import accumulate, permutations, combinations, productfrom operator import itemgetter, mulfrom copy import deepcopyfrom string import ascii_lowercase, ascii_uppercase, digitsfrom bisect import bisect, bisect_leftfrom heapq import heappush, heappopfrom functools import reducedef input(): return sys.stdin.readline().strip()def INT(): return int(input())def MAP(): return map(int, input().split())def LIST(): return list(map(int, input().split()))sys.setrecursionlimit(10 ** 9)INF = float('inf')mod = 10 ** 9 + 7N = INT()a, b, c = MAP()def lcm(x, y):return (x * y) // gcd(x, y)ans = N//a + N//b + N//c - N//lcm(a, b) - N//lcm(a, c) - N//lcm(b, c) + N//lcm(lcm(a, b), c)print(ans)