Skip to content

Instantly share code, notes, and snippets.

View CampioniMan's full-sized avatar
😜
Primeiro faço, depois penso

Daniel Campioni CampioniMan

😜
Primeiro faço, depois penso
View GitHub Profile
@CampioniMan
CampioniMan / BellmanFordCSharp.cs
Last active April 27, 2025 23:05
Bellman-Ford implementation
// .NET 8.0.204 (C# 11 Roslyn compiler)
// weighted directed graph
// non-greedy algorithm
// works with negative edges but NOT with negative cycles!
var counts = Console.ReadLine()!.Split().Select(int.Parse).ToArray();
var edgeCount = counts[0];
var nodeCount = counts[1];
var edges = new (int, int, int)[edgeCount];
@CampioniMan
CampioniMan / palin.asm
Last active March 8, 2023 04:45
Assembly code about palindrome words
section .data
msg db 'tuutt',0xa ;the string about to be tested
len equ $ - msg ;length of the string
sim db 'sim',0xa ;good final result (palindrome)
nao db 'nao',0xa ;bad final result (not palindrome)
lenO equ 4
section .text
global _start ;must be declared for using gcc