Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同種の let があればまとめる #137

Open
kmyk opened this issue Aug 4, 2021 · 0 comments
Open

同種の let があればまとめる #137

kmyk opened this issue Aug 4, 2021 · 0 comments

Comments

@kmyk
Copy link
Collaborator

kmyk commented Aug 4, 2021

Description / 説明

もし

let x = e(...)
in let y = e(...)
in f(x, y)

があったら

let x = e(...)
in f(x, x)

にする

Motivation / 動機

定数倍しか変わらないけど、違うループの中で別々に作られた同じ累積和とかはまとめたい

for i in range(n):
   ans += sum(a[:i])
for i in range(n):
   ans += sum(a[:i])
@kmyk kmyk added good first issue Good for newcomers and removed good first issue Good for newcomers labels Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant