Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Combinatorics
- if length(ARGS) >=1
- set_size_1 = parse(Int,ARGS[1])
- else
- set_size_1 = 30
- end
- println(set_size_1)
- set_size_2 = 8
- set_size_3 = 4
- set_1 = (1:set_size_1)
- max_sum = sum(set_size_1:-1:set_size_1-set_size_3+1)
- println(max_sum)
- sarray = Array{UInt8}(undef, max_sum)
- for set_2 = combinations(set_1, set_size_2)
- found = true
- sarray .= 0
- for set_3 = combinations(set_2, set_size_3)
- s = sum(set_3)
- if sarray[s]>=1
- found = false
- break
- else
- sarray[s]+=1
- end
- end
- if found
- println(set_2)
- println(sarray)
- end
- end
- println("finished")
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement