make types lowercase :)

This commit is contained in:
2025-12-22 21:21:15 +01:00
parent 7c23e57ec0
commit ebc887fb5b
40 changed files with 438 additions and 438 deletions

View File

@@ -1,29 +1,29 @@
func part1[l1: Array, l2: Array] : Void
let out: I64 = 0
func part1[l1: array, l2: array] : void
let out: i64 = 0
for i in 0..array.size(l1)
out = out + math.abs(array.nth(l1, i) - array.nth(l2, i))
io.println_i64(out)
func part2[l1: Array, l2: Array] : Void
let out: I64 = 0
func part2[l1: array, l2: array] : void
let out: i64 = 0
for i in 0..array.size(l1)
out = out + array.nth(l1, i) * alg.count(l2, array.nth(l1, i))
io.println_i64(out)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
let l1: Array = []
let l2: Array = []
let l1: array = []
let l2: array = []
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let line: str = array.nth(lines, i)
let parts: Array = str.split(line, " ")
let parts: array = str.split(line, " ")
array.push(l1, str.parse_i64(array.nth(parts, 0)))
array.push(l2, str.parse_i64(array.nth(parts, 1)))

View File

@@ -1,5 +1,5 @@
func check[report: Array] : Bool
let increasing: Bool = array.nth(report, 0) < array.nth(report, 1)
func check[report: array] : bool
let increasing: bool = array.nth(report, 0) < array.nth(report, 1)
for i in 0..array.size(report)-1
if array.nth(report, i) > array.nth(report, i + 1) & increasing
@@ -7,14 +7,14 @@ func check[report: Array] : Bool
if array.nth(report, i) < array.nth(report, i + 1) & !increasing
return false
let diff: I64 = math.abs(array.nth(report, i) - array.nth(report, i + 1))
let diff: i64 = math.abs(array.nth(report, i) - array.nth(report, i + 1))
if diff < 1 | diff > 3
return false
return true
func part1[data: Array] : Void
let out: I64 = 0
func part1[data: array] : void
let out: i64 = 0
for i in 0..array.size(data)
if check(array.nth(data, i))
@@ -22,15 +22,15 @@ func part1[data: Array] : Void
io.println_i64(out)
func part2[data: Array] : Void
let out: I64 = 0
func part2[data: array] : void
let out: i64 = 0
for i in 0..array.size(data)
if check(array.nth(data, i))
out = out + 1
else
for j in 0..array.size(array.nth(data, i))
let sliced: Array = array.concat(array.slice(array.nth(data, i), 0, j), array.slice(array.nth(data, i), j + 1, array.size(array.nth(data, i)) - (j + 1)))
let sliced: array = array.concat(array.slice(array.nth(data, i), 0, j), array.slice(array.nth(data, i), j + 1, array.size(array.nth(data, i)) - (j + 1)))
if check(sliced)
out = out + 1
@@ -38,14 +38,14 @@ func part2[data: Array] : Void
io.println_i64(out)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
let data: Array = []
let data: array = []
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let line: str = array.nth(lines, i)
let report: Array = str.split(line, " ")
let report: array = str.split(line, " ")
for i in 0..array.size(report)
array.set(report, i, str.parse_i64(array.nth(report, i)))
array.push(data, report)

View File

@@ -1,4 +1,4 @@
func check[lines: Array, x: I64, y: I64, dx: I64, dy: I64] : Bool
func check[lines: array, x: i64, y: i64, dx: i64, dy: i64] : bool
if x + dx * 3 < 0 | x + dx * 3 >= array.size(lines) | y + dy * 3 < 0 | y + dy * 3 >= str.len(array.nth(lines, 0))
return false
@@ -13,8 +13,8 @@ func check[lines: Array, x: I64, y: I64, dx: I64, dy: I64] : Bool
return true
func part1[lines: Array] : Void
let out: I64 = 0
func part1[lines: array] : void
let out: i64 = 0
for x in 0..array.size(lines)
for y in 0..str.len(array.nth(lines, x))
@@ -37,13 +37,13 @@ func part1[lines: Array] : Void
io.println_i64(out)
func part2[lines: Array] : Void
let out: I64 = 0
func part2[lines: array] : void
let out: i64 = 0
for x in 1..array.size(lines)-1
for y in 1..str.len(array.nth(lines, x))-1
if array.nth(lines, x)[y] == 'A'
let s: String = mem.alloc(5)
let s: str = mem.alloc(5)
str.set(s, 0, array.nth(lines, x - 1)[y - 1])
str.set(s, 1, array.nth(lines, x + 1)[y - 1])
str.set(s, 2, array.nth(lines, x + 1)[y + 1])
@@ -55,8 +55,8 @@ func part2[lines: Array] : Void
io.println_i64(out)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
part1(lines)
part2(lines)

View File

@@ -1,69 +1,69 @@
func rule_exists[rules_left: Array, rules_right: Array, a: I64, b: I64] : Bool
func rule_exists[rules_left: array, rules_right: array, a: i64, b: i64] : bool
for k in 0..array.size(rules_left)
if array.nth(rules_left, k) == a & array.nth(rules_right, k) == b
return true
return false
func check[update: Array, rules_left: Array, rules_right: Array] : Bool
func check[update: array, rules_left: array, rules_right: array] : bool
for i in 0..array.size(update)
for j in 0..i
if rule_exists(rules_left, rules_right, array.nth(update, i), array.nth(update, j))
return false
return true
func sort_by_rules[update: Array, rules_left: Array, rules_right: Array] : Void
let swapped: Bool = true
func sort_by_rules[update: array, rules_left: array, rules_right: array] : void
let swapped: bool = true
while swapped
swapped = false
for i in 0..array.size(update)-1
let a: I64 = array.nth(update, i)
let b: I64 = array.nth(update, i+1)
let a: i64 = array.nth(update, i)
let b: i64 = array.nth(update, i+1)
if rule_exists(rules_left, rules_right, b, a)
let tmp: I64 = a
let tmp: i64 = a
array.set(update, i, b)
array.set(update, i+1, tmp)
swapped = true
func part1[updates: Array, rules_left: Array, rules_right: Array] : Void
let out: I64 = 0
func part1[updates: array, rules_left: array, rules_right: array] : void
let out: i64 = 0
for i in 0..array.size(updates)
let update: Array = array.nth(updates, i)
let update: array = array.nth(updates, i)
if check(update, rules_left, rules_right)
out = out + array.nth(update, array.size(update) / 2)
io.println_i64(out)
func part2[updates: Array, rules_left: Array, rules_right: Array] : Void
let out: I64 = 0
func part2[updates: array, rules_left: array, rules_right: array] : void
let out: i64 = 0
for i in 0..array.size(updates)
let update: Array = array.nth(updates, i)
let update: array = array.nth(updates, i)
if !check(update, rules_left, rules_right)
sort_by_rules(update, rules_left, rules_right)
out = out + array.nth(update, array.size(update) / 2)
io.println_i64(out)
func main[] : I64
let data: Array = io.read_file("input.txt") |> str.split("\n\n")
func main[] : i64
let data: array = io.read_file("input.txt") |> str.split("\n\n")
let rules_left: Array = []
let rules_right: Array = []
let rules_lines: Array = str.split(array.nth(data, 0), "\n")
let rules_left: array = []
let rules_right: array = []
let rules_lines: array = str.split(array.nth(data, 0), "\n")
for i in 0..array.size(rules_lines)
let line: String = array.nth(rules_lines, i)
let parts: Array = str.split(line, "|")
let line: str = array.nth(rules_lines, i)
let parts: array = str.split(line, "|")
array.push(rules_left, str.parse_i64(array.nth(parts, 0)))
array.push(rules_right, str.parse_i64(array.nth(parts, 1)))
let updates: Array = []
let updates_lines: Array = str.split(array.nth(data, 1), "\n")
let updates: array = []
let updates_lines: array = str.split(array.nth(data, 1), "\n")
for i in 0..array.size(updates_lines)
let line: String = array.nth(updates_lines, i)
let xs: Array = str.split(line, ",")
let line: str = array.nth(updates_lines, i)
let xs: array = str.split(line, ",")
for i in 0..array.size(xs)
array.set(xs, i, str.parse_i64(array.nth(xs, i)))

View File

@@ -1,24 +1,24 @@
func concat[a: I64, b: I64] : I64
let a_str: String = str.from_i64(a)
let b_str: String = str.from_i64(b)
let ab_str: String = str.concat(a_str, b_str)
let out: I64 = str.parse_i64(ab_str)
func concat[a: i64, b: i64] : i64
let a_str: str = str.from_i64(a)
let b_str: str = str.from_i64(b)
let ab_str: str = str.concat(a_str, b_str)
let out: i64 = str.parse_i64(ab_str)
// without freeing the program works but leaks 2GB of memory :p
mem.free(a_str)
mem.free(b_str)
mem.free(ab_str)
return out
func solve[ops: Array, e: Array] : I64
let n: I64 = array.size(array.nth(e, 1)) - 1
let indices: Array = []
func solve[ops: array, e: array] : i64
let n: i64 = array.size(array.nth(e, 1)) - 1
let indices: array = []
for i in 0..n
array.push(indices, 0)
while true
let res: I64 = array.nth(array.nth(e, 1), 0)
let res: i64 = array.nth(array.nth(e, 1), 0)
for i in 0..n
let op: String = array.nth(ops, array.nth(indices, i))
let op: str = array.nth(ops, array.nth(indices, i))
if str.equal(op, "add")
res = res + array.nth(array.nth(e, 1), i + 1)
@@ -29,8 +29,8 @@ func solve[ops: Array, e: Array] : I64
if res == array.nth(e, 0)
return res
let done: Bool = true
let i: I64 = n - 1
let done: bool = true
let i: i64 = n - 1
while i >= 0
array.set(indices, i, array.nth(indices, i) + 1)
@@ -43,31 +43,31 @@ func solve[ops: Array, e: Array] : I64
if done
return 0
func part1[equations: Array] : Void
let out: I64 = 0
func part1[equations: array] : void
let out: i64 = 0
for i in 0..array.size(equations)
out = out + solve(["add", "mul"], array.nth(equations, i))
io.println_i64(out)
func part2[equations: Array] : Void
let out: I64 = 0
func part2[equations: array] : void
let out: i64 = 0
for i in 0..array.size(equations)
out = out + solve(["add", "mul", "concat"], array.nth(equations, i))
io.println_i64(out)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
let equations: Array = []
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
let equations: array = []
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let parts: Array = str.split(line, ": ")
let line: str = array.nth(lines, i)
let parts: array = str.split(line, ": ")
let xs: Array = str.split(array.nth(parts, 1), " ")
let xs: array = str.split(array.nth(parts, 1), " ")
for j in 0..array.size(xs)
array.set(xs, j, str.parse_i64(array.nth(xs, j)))

View File

@@ -1,11 +1,11 @@
func part1[lines: Array] : Void
let password: I64 = 0
let dial: I64 = 50
func part1[lines: array] : void
let password: i64 = 0
let dial: i64 = 50
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let dir: U8 = line[0]
let n: I64 = str.substr(line, 1, str.len(line) - 1) |> str.parse_i64()
let line: str = array.nth(lines, i)
let dir: u8 = line[0]
let n: i64 = str.substr(line, 1, str.len(line) - 1) |> str.parse_i64()
if dir == 'L'
dial = dial - n
@@ -21,14 +21,14 @@ func part1[lines: Array] : Void
io.println_i64(password)
func part2[lines: Array] : Void
let password: I64 = 0
let dial: I64 = 50
func part2[lines: array] : void
let password: i64 = 0
let dial: i64 = 50
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let dir: U8 = line[0]
let n: I64 = str.substr(line, 1, str.len(line) - 1) |> str.parse_i64()
let line: str = array.nth(lines, i)
let dir: u8 = line[0]
let n: i64 = str.substr(line, 1, str.len(line) - 1) |> str.parse_i64()
if dir == 'L'
for i in 0..n
@@ -46,8 +46,8 @@ func part2[lines: Array] : Void
io.println_i64(password)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
part1(lines)
part2(lines)

View File

@@ -1,20 +1,20 @@
func part1_is_invalid_id[s: String] : Bool
let len: I64 = str.len(s)
func part1_is_invalid_id[s: str] : bool
let len: i64 = str.len(s)
if len % 2 != 0
return false
let first: String = str.substr(s, 0, len / 2)
let second: String = str.substr(s, len / 2, len / 2)
let first: str = str.substr(s, 0, len / 2)
let second: str = str.substr(s, len / 2, len / 2)
return str.equal(first, second)
func part1[ranges: Array] : Void
let sum: I64 = 0
func part1[ranges: array] : void
let sum: i64 = 0
for i in 0..array.size(ranges)
let parts: Array = array.nth(ranges, i) |> str.split("-")
let start: I64 = array.nth(parts, 0) |> str.parse_i64()
let end: I64 = array.nth(parts, 1) |> str.parse_i64()
let parts: array = array.nth(ranges, i) |> str.split("-")
let start: i64 = array.nth(parts, 0) |> str.parse_i64()
let end: i64 = array.nth(parts, 1) |> str.parse_i64()
for n in (start)..end+1
if part1_is_invalid_id(str.from_i64(n))
@@ -23,29 +23,29 @@ func part1[ranges: Array] : Void
io.println_i64(sum)
// had to cheat this one
func part2_is_invalid_id[s: String] : Bool
let len: I64 = str.len(s)
func part2_is_invalid_id[s: str] : bool
let len: i64 = str.len(s)
if len < 2
return false
for div in 1..(len / 2 + 1)
if len % div == 0
let u: String = str.substr(s, 0, div)
let is_repeat: Bool = true
let u: str = str.substr(s, 0, div)
let is_repeat: bool = true
for k in 1..(len / div)
let segment: String = str.substr(s, k * div, div)
let segment: str = str.substr(s, k * div, div)
if !str.equal(segment, u)
is_repeat = false
if is_repeat
return true
return false
func part2[ranges: Array] : Void
let sum: I64 = 0
func part2[ranges: array] : void
let sum: i64 = 0
for i in 0..array.size(ranges)
let parts: Array = array.nth(ranges, i) |> str.split("-")
let start: I64 = array.nth(parts, 0) |> str.parse_i64()
let end: I64 = array.nth(parts, 1) |> str.parse_i64()
let parts: array = array.nth(ranges, i) |> str.split("-")
let start: i64 = array.nth(parts, 0) |> str.parse_i64()
let end: i64 = array.nth(parts, 1) |> str.parse_i64()
for n in (start)..end+1
if part2_is_invalid_id(str.from_i64(n))
@@ -53,8 +53,8 @@ func part2[ranges: Array] : Void
io.println_i64(sum)
func main[] : I64
let ranges: Array = io.read_file("input.txt") |> str.split(",")
func main[] : i64
let ranges: array = io.read_file("input.txt") |> str.split(",")
part1(ranges)
part2(ranges)

View File

@@ -1,17 +1,17 @@
func part1[lines: Array] : Void
let sum: I64 = 0
func part1[lines: array] : void
let sum: i64 = 0
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let line: str = array.nth(lines, i)
let largest: I64 = 0
let largest: i64 = 0
for j in 0..str.len(line)
for k in (j+1)..str.len(line)
let s: String = mem.alloc(3)
let s: str = mem.alloc(3)
str.set(s, 0, line[j])
str.set(s, 1, line[k])
str.set(s, 2, 0)
let n: I64 = str.parse_i64(s)
let n: i64 = str.parse_i64(s)
if n > largest
largest = n
@@ -19,13 +19,13 @@ func part1[lines: Array] : Void
io.println_i64(sum)
// had to cheat this one
func part2_rec[bank: String, start: I64, remaining: I64] : I64
let largest: I64 = 0
let largest_idx: I64 = start
let len: I64 = str.len(bank)
func part2_rec[bank: str, start: i64, remaining: i64] : i64
let largest: i64 = 0
let largest_idx: i64 = start
let len: i64 = str.len(bank)
for i in (start)..(len-remaining+1)
let v: I64 = bank[i] - '0'
let v: i64 = bank[i] - '0'
if v > largest
largest = v
largest_idx = i
@@ -35,17 +35,17 @@ func part2_rec[bank: String, start: I64, remaining: I64] : I64
else
return largest
func part2[lines: Array] : Void
let sum: I64 = 0
func part2[lines: array] : void
let sum: i64 = 0
for i in 0..array.size(lines)
let line: String = array.nth(lines, i)
let line: str = array.nth(lines, i)
sum = sum + part2_rec(line, 0, 12)
io.println_i64(sum)
func main[] : I64
let lines: Array = io.read_file("input.txt") |> str.split("\n")
func main[] : i64
let lines: array = io.read_file("input.txt") |> str.split("\n")
part1(lines)
part2(lines)

View File

@@ -1,5 +1,5 @@
func main[] : I64
let sum: I64 = 0
func main[] : i64
let sum: i64 = 0
for i in 0..2000000
if math.is_prime(i)

View File

@@ -1,7 +1,7 @@
func num_divisors[n: I64] : I64
let end: I64 = math.isqrt(n)
func num_divisors[n: i64] : i64
let end: i64 = math.isqrt(n)
let out: I64 = 0
let out: i64 = 0
for i in 1..end+1
if n % i == 0
out = out + 2
@@ -10,9 +10,9 @@ func num_divisors[n: I64] : I64
out = out - 1
return out
func main[] : I64
let n: I64 = 0
let i: I64 = 1
func main[] : i64
let n: i64 = 0
let i: i64 = 1
while true
n = n + i
if num_divisors(n) > 500

View File

@@ -1,4 +1,4 @@
func main[] : I64
func main[] : i64
// leaks a bit of memory but looks very cool
37107287533 + 46376937677 + 74324986199 + 91942213363 + 23067588207 + 89261670696 + 28112879812 + 44274228917 + 47451445736 + 70386486105 + 62176457141 + 64906352462 + 92575867718 + 58203565325 + 80181199384 + 35398664372 + 86515506006 + 71693888707 + 54370070576 + 53282654108 + 36123272525 + 45876576172 + 17423706905 + 81142660418 + 51934325451 + 62467221648 + 15732444386 + 55037687525 + 18336384825 + 80386287592 + 78182833757 + 16726320100 + 48403098129 + 87086987551 + 59959406895 + 69793950679 + 41052684708 + 65378607361 + 35829035317 + 94953759765 + 88902802571 + 25267680276 + 36270218540 + 24074486908 + 91430288197 + 34413065578 + 23053081172 + 11487696932 + 63783299490 + 67720186971 + 95548255300 + 76085327132 + 37774242535 + 23701913275 + 29798860272 + 18495701454 + 38298203783 + 34829543829 + 40957953066 + 29746152185 + 41698116222 + 62467957194 + 23189706772 + 86188088225 + 11306739708 + 82959174767 + 97623331044 + 42846280183 + 55121603546 + 32238195734 + 75506164965 + 62177842752 + 32924185707 + 99518671430 + 73267460800 + 76841822524 + 97142617910 + 87783646182 + 10848802521 + 71329612474 + 62184073572 + 66627891981 + 60661826293 + 85786944089 + 66024396409 + 64913982680 + 16730939319 + 94809377245 + 78639167021 + 15368713711 + 40789923115 + 44889911501 + 41503128880 + 81234880673 + 82616570773 + 22918802058 + 77158542502 + 72107838435 + 20849603980 + 53503534226
|> str.from_i64()

View File

@@ -1,21 +1,21 @@
func collatz_num[n: I64] : I64
func collatz_num[n: i64] : i64
if n % 2 == 0
return n / 2
return n * 3 + 1
func collatz_seq[n: I64]: I64
let i: I64 = 1
func collatz_seq[n: i64]: i64
let i: i64 = 1
while n != 1
n = collatz_num(n)
i = i + 1
return i
func main[] : I64
let max: I64 = 0
let max_index: I64 = 0
func main[] : i64
let max: i64 = 0
let max_index: i64 = 0
for i in 1..1000000
let seq: I64 = collatz_seq(i)
let seq: i64 = collatz_seq(i)
if seq > max
max = seq
max_index = i

View File

@@ -1,7 +1,7 @@
func main[] : I64
let n: I64 = 40
let r: I64 = 20
let out: I64 = 1
func main[] : i64
let n: i64 = 40
let r: i64 = 20
let out: i64 = 1
for i in 1..r+1
out = out * (n - (r - i)) / i

View File

@@ -1,5 +1,5 @@
func main[] : I64
let sum: I64 = 0
func main[] : i64
let sum: i64 = 0
for i in 0..1000
if i % 5 == 0 | i % 3 == 0

View File

@@ -1,12 +1,12 @@
func main[] : I64
let sum: I64 = 0
let a: I64 = 0
let b: I64 = 1
func main[] : i64
let sum: i64 = 0
let a: i64 = 0
let b: i64 = 1
while a < 4000000
if a % 2 == 0
sum = sum + a
let temp: I64 = b
let temp: i64 = b
b = a + b
a = temp

View File

@@ -1,6 +1,6 @@
func main[] : I64
let n: I64 = 600851475143
let f: I64 = 2
func main[] : i64
let n: i64 = 600851475143
let f: i64 = 2
while f * f <= n
if n % f == 0

View File

@@ -1,11 +1,11 @@
func main[] : I64
let out: I64 = 0
func main[] : i64
let out: i64 = 0
for a in 500..1000
for b in 500..1000
if a * b > out
let s: String = str.from_i64(a * b)
let s_rev: String = str.reverse(s)
let s: str = str.from_i64(a * b)
let s_rev: str = str.reverse(s)
if str.equal(s, s_rev)
out = a * b
mem.free(s)

View File

@@ -1,5 +1,5 @@
func main[] : I64
let out: I64 = 1
func main[] : i64
let out: i64 = 1
for i in 1..21
out = math.lcm(out, i)

View File

@@ -1,9 +1,9 @@
func main[] : I64
let sum_of_squares: I64 = 0
func main[] : i64
let sum_of_squares: i64 = 0
for i in 1..101
sum_of_squares = sum_of_squares + i * i
let square_of_sum: I64 = 0
let square_of_sum: i64 = 0
for i in 1..101
square_of_sum = square_of_sum + i
square_of_sum = square_of_sum * square_of_sum

View File

@@ -1,7 +1,7 @@
func main[] : I64
let found: I64 = 0
func main[] : i64
let found: i64 = 0
let i: I64 = 1
let i: i64 = 1
while true
if math.is_prime(i)
found = found + 1

View File

@@ -1,11 +1,11 @@
func main[] : I64
let n: String = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
func main[] : i64
let n: str = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
let out: I64 = 0
let max: I64 = str.len(n) - 13
let out: i64 = 0
let max: i64 = str.len(n) - 13
for i in 0..max
let s: I64 = 1
let j: I64 = 0
let s: i64 = 1
let j: i64 = 0
while j < 13
s = s * (n[i + j] - '0')
j = j + 1

View File

@@ -1,7 +1,7 @@
func main[] : I64
func main[] : i64
for a in 1..1000
for b in 1..1000
let c: I64 = 1000 - b - a
let c: i64 = 1000 - b - a
if a * a + b * b == c * c
io.println_i64(a * b * c)
return 0