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

\sum_{i<n} \sum_{j>i} |a_i-a_j| を解けるようにする #213

Open
kmyk opened this issue Sep 4, 2021 · 1 comment
Open

\sum_{i<n} \sum_{j>i} |a_i-a_j| を解けるようにする #213

kmyk opened this issue Sep 4, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@kmyk
Copy link
Collaborator

kmyk commented Sep 4, 2021

Description / 説明

現在は実装が途中までなので \sum_{i<n} \sum_{j<n} |a_i-a_j| https://judge.kimiyuki.net/problem/sum-sum-abs-one しか解けない。

現在は sum (map (fun a_i -> (sum (map (fun a_j -> abs (a_i - a_j))) a)) a) を簡約しているが sum (map (fun i -> (sum (map (fun j -> abs (a[i] - a[j]))) (range (len a)))) (range (len a))) とかも受け入れるようにしたい

現在のソースコード: https://github.com/kmyk/Jikka/blob/master/src/Jikka/Core/Convert/SortAbs.hs

Motivation / 動機

https://judge.kimiyuki.net/problem/sum_sum_abs_one_lt これが解きたい

@kmyk kmyk added the good first issue Good for newcomers label Sep 4, 2021
@kmyk
Copy link
Collaborator Author

kmyk commented Sep 4, 2021

ちょっと重めだけど他よりましだから good first issue 付けとこ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant