2024-04-04 20:05:57 +02:00
|
|
|
u32 c(u32 n) {
|
|
|
|
u32 sum = 0u32;
|
|
|
|
while(n > 0u32) {
|
|
|
|
sum += n;
|
|
|
|
n -= 1u32;
|
|
|
|
}
|
|
|
|
return sum;
|
2024-03-30 21:57:38 +01:00
|
|
|
}
|
2024-04-09 13:57:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
u64 fib(u64 i) {
|
|
|
|
u64 fibA = 0u64;
|
|
|
|
u64 fibB = 1u64;
|
|
|
|
|
2024-04-11 13:40:04 +02:00
|
|
|
while(--i > 0u64) {
|
2024-04-09 13:57:17 +02:00
|
|
|
u64 tmp = fibB;
|
|
|
|
fibB = fibA + fibB;
|
|
|
|
fibA = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
return fibA;
|
|
|
|
}
|
2024-04-18 21:14:55 +02:00
|
|
|
|
|
|
|
(u64, u64) add(u64 a) {
|
|
|
|
u64 x = a++;
|
|
|
|
return x, a;
|
|
|
|
}
|
|
|
|
|
|
|
|
(u64, u64) tuple() {
|
|
|
|
return 1u64, 2u64;
|
|
|
|
}
|
|
|
|
|
|
|
|
u64 sub(u64 a) {
|
|
|
|
return --raw(u64, 0xFFu64);
|
|
|
|
}
|
2024-04-20 13:56:41 +02:00
|
|
|
|
|
|
|
u64 assign(u64 a) {
|
|
|
|
a += 1u64;
|
|
|
|
return raw(u64, a) += 2u64;
|
|
|
|
}
|