Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/McNuggets-problem/Dyalect/mcnuggets-problem.dyalect
Normal file
18
Task/McNuggets-problem/Dyalect/mcnuggets-problem.dyalect
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
func mcnugget(limit) {
|
||||
var sv = Array.Empty(limit + 1, false)
|
||||
for s in 0^6..limit {
|
||||
for n in s^9..limit {
|
||||
for t in n^20..limit {
|
||||
sv[t] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
for i in limit^-1..0 {
|
||||
if !sv[i] {
|
||||
print("Maximum non-McNuggets number is \(i)")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mcnugget(100)
|
||||
Loading…
Add table
Add a link
Reference in a new issue