This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code C++ MasterClass (Algorithms with C++ MasterClass) by Fabio Galuppo | |
//C++ MasterClass - https://www.linkedin.com/company/cppmasterclass - https://cppmasterclass.com.br/ | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//March 2025 | |
//g++ -O3 -std=c++20 _demo_generator.cpp -o a.exe | |
//cl /Fo.\obj\ /EHsc /O2 /std:c++20 _demo_generator.cpp /link /out:a.exe | |
#include <iomanip> | |
#include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code C++ MasterClass (Algorithms with C++ MasterClass) by Fabio Galuppo | |
//C++ MasterClass - https://www.linkedin.com/company/cppmasterclass - https://cppmasterclass.com.br/ | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//This file is licensed to you under the MIT license | |
//March 2025 | |
//For C++ 20, in C++ 23 use std::generator instead: https://en.cppreference.com/w/cpp/coroutine/generator | |
#ifndef GENERATOR_HPP | |
#define GENERATOR_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code by Fabio Galuppo | |
//C++ MasterClass - https://www.linkedin.com/company/cppmasterclass - https://cppmasterclass.com.br/ | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//March 2025 | |
//g++ -O3 -std=c++20 istream_helper_util.t.cpp -o a.exe | |
#include "istream_helper_util.h" | |
#include <algorithm> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code by Fabio Galuppo | |
//C++ MasterClass - https://www.linkedin.com/company/cppmasterclass - https://cppmasterclass.com.br/ | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//March 2025 | |
#ifndef ISTREAM_HELPER_UTIL_H | |
#define ISTREAM_HELPER_UTIL_H | |
#include <functional> | |
#include <istream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code SDL PPM P3 Viewer por Fabio Galuppo | |
//C++ MasterClass - https://www.linkedin.com/company/cppmasterclass - https://www.youtube.com/@CPPMasterClass | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//July 2024 | |
#define SDL_MAIN_HANDLED | |
#include <SDL.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
#1st version - Mar 2021 | |
#2nd version - Feb 2024 | |
import pygame | |
import os | |
import math | |
from datetime import datetime | |
def wallclock(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source code do curso Algoritmos com C++ por Fabio Galuppo | |
//Ministrado em 2022 na Agit - https://www.agit.com.br/cursoalgoritmos.php | |
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - [email protected] | |
//Atualizado em 2024-01-17 | |
//This file is licensed to you under the MIT license | |
//Ref.: https://sean-parent.stlab.cc/presentations/2021-03-13-relationships/2021-03-13-relationships.pdf | |
#ifndef REGISTRY_HPP | |
#define REGISTRY_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Quick C++ Benchmarks link: https://quick-bench.com/q/mvKK4FzyZGTNSFr5Qe6i1akzzro | |
#include <cstddef> | |
#include <unordered_map> | |
#include <string> | |
#include <utility> | |
static const std::uint64_t FNV1_64_INIT = 0xcbf29ce484222325ULL; | |
//FNV-1 hash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Data | |
[<Literal>] | |
let MegaSena_Url = "http://loterias.caixa.gov.br/wps/portal/loterias/landing/megasena/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOLNDH0MPAzcDbwMPI0sDBxNXAOMwrzCjA0sjIEKIoEKnN0dPUzMfQwMDEwsjAw8XZw8XMwtfQ0MPM2I02-AAzgaENIfrh-FqsQ9wNnUwNHfxcnSwBgIDUyhCvA5EawAjxsKckMjDDI9FQE-F4ca/dl5/d5/L2dBISEvZ0FBIS9nQSEh/pw/Z7_HGK818G0K8DBC0QPVN93KQ10G1/res/id=historicoHTML/c=cacheLevelPage/=/" | |
type MegaSena_Results = HtmlProvider<MegaSena_Url, PreferOptionals=true> | |
let instanceMegaSena = MegaSena_Results.GetSample() | |
let data = instanceMegaSena.Tables.Table1 | |
for x in data.Rows do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def greedyCoinsChange(A, C): | |
C.sort(reverse = True) | |
counter = 0 | |
for c in C: | |
if (A > 0): | |
counter = counter + (A // c) | |
A = A % c | |
else: | |
break | |
return counter |
NewerOlder