結果
| 問題 |
No.546 オンリー・ワン
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-01-27 21:39:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 374 bytes |
| コンパイル時間 | 1,523 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 66,700 KB |
| 最終ジャッジ日時 | 2025-01-27 21:39:28 |
| 合計ジャッジ時間 | 1,732 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 |
ソースコード
from math import lcm
from itertools import combinations
N, L, H = map(int, input().split())
CS = list(map(int, input().split()))
L -= 1
AH = 0
AL = 0
t = 1
for i in range(1, N + 1):
t2 = t * i
for C in combinations(CS, i):
m = 1
for c in C:
m = lcm(m,c)
AL += (L // m) * t2
AH += (H // m) * t2
t *= -1
print(AH - AL)
ntuda