split std

This commit is contained in:
2026-07-01 14:43:39 +02:00
parent 3a4a499cf6
commit bc4e09805b
53 changed files with 1415 additions and 1279 deletions

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
sum := 0

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
sum := 0

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
sum := 0
a := 0

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
n := 600851475143
f := 2

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
out := 0

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
out := 1

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
sum_of_squares := 0
for i in 1..101

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
found := 0

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
n := "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
for a in 1..1000
for b in 1..1000

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
sum := 0

View File

@@ -1,3 +1,6 @@
include "std/io.zr"
include "std/containers.zr"
func main[] : i64
N := 20

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func num_divisors[n: i64] : i64
end := n->isqrt()

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
n := 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
io.println(n->to_str()->substr(0, 10))

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func collatz_num[n: i64] : i64
if n % 2 == 0
return n / 2

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func main[] : i64
n := 40
r := 20

View File

@@ -1,3 +1,6 @@
include "std/io.zr"
include "std/containers.zr"
func main[] : i64
n := [1]

View File

@@ -1,3 +1,6 @@
include "std/io.zr"
include "std/containers.zr"
func main[] : i64
s1 := [0, 3, 3, 5, 4, 4, 3, 5, 5, 4]
s2 := [3, 6, 6, 8, 8, 7, 7, 9, 8, 8]

View File

@@ -1,3 +1,6 @@
include "std/io.zr"
include "std/containers.zr"
func findmax[triangle: Array, row: i64, col: i64] : i64
if row == 14
return (triangle->nth(row) as Array)->nth(col)

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func days[y: i64, m: i64] : i64
if m == 2
if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))

View File

@@ -1,3 +1,6 @@
include "std/io.zr"
include "std/containers.zr"
func multiply[n: Array, x: i64] : void
carry := 0
for i in 0..n->size

View File

@@ -1,3 +1,5 @@
include "std/io.zr"
func divisors_sum[n: i64] : i64
k := n
sum := 1