This file contains 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
#!/usr/bin/env python3 | |
# Copyright (c) 2022 Arthur Ferreira | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
#include <algorithm> | |
#include <limits.h> | |
using std::chrono::high_resolution_clock; | |
using std::chrono::duration; | |
This file contains 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
#include <iostream> | |
#include <cmath> | |
#include <thread> | |
#include <future> | |
typedef unsigned long long int huge; | |
bool hasDivisors = false; // until we find one | |
// Thread function |
This file contains 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
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
cout << endl; | |
for(int i=1; i<=100; i++){ | |
if ( !((i%3) || (i%5)) ) // Loi de morgan : « non(A ou B) » equivaut à « (non A) et (non B) ». | |
// if (!(i%15)) ... if you take the time to think a bit ! |
This file contains 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
#include <iostream> | |
#define NUM 20000 | |
#define MAX_ITER 100000 | |
int main() { | |
int results[NUM] = {0}; | |
int maxIter = 0; | |
int numberForMaxIter = 0; |