Profile Picture

pooperlegend

Reputation: 0 [rate]

Joined: Jun, 2023

Last online:

https://media.discordapp.net/attachments/1074297826219139153/1118491534581567568/Mask_group.png

Badges

badge

Etc

Send Message

Threads List
Possible Alts

Activity Feed

Replied to thread : [ Semi-CW ] Ezsploits, Using DLL without permission, Toxicity


@bennytrt they are different Easyexploits and this n*gga is different

easyexploits bought rights to use the dll
 this kid didnt

Replied to thread : is macbook m1 good enough to develop game on ue5?


@Astronemi Asahi linux does exist

and wine works on it

Created a new thread : my 2 cents on the Joztyn and Pluto_guy situation


I think both of them are guilty in their own ways dragging out drama this long aint fun at this point you guys are rivaling indian melodrama series.

Now the pluto_guy "Impersonator" could be pluto trying to frame joztyn, joztyn trying to frame pluto or a random individual making fun of this situation

out of this my most notable suspects are Ishan and Pluto. joztyn just seems sad LMFAO

Replied to thread : Somebodies pretending to be me


i dont know who to believe :skull:

Replied to thread : Atonix V3 | Updates and UI


gross syntax highlighting

Replied to thread : CodeWars V2 in any language


@B00M the testing results were tested on 32 threads i was modifying the code to check for bugs later so yeh mine was tested on 32 threads

 

Replied to thread : CodeWars V2 in any language


@B00M
ignore the extra 0.1 second idk why thats happening its hard coded to stop exactly at 5 seconds
https://cdn.discordapp.com/attachments/1065628036994715679/1121457757464313866/image.png


#include <iostream>
#include <vector>
#include <chrono>
#include <thread>
#include <atomic>

using namespace std;
using namespace std::chrono;

const int limit = 1000000;
const int numThreads = 48;

void sieveThread(vector<char>& sieve, atomic<int>& passes) {
    while (true) {
        int p = 2;
        for (; p * p <= limit; p++) {
            if (sieve[p]) {
                for (int i = p * p; i <= limit; i += p) {
                    sieve[i] = false;
                }
            }
        }
        passes++;
    }
}

int main() {
    int count = 0;
    atomic<int> passes(0);

    vector<char> sieve(limit + 1, true);
    vector<thread> threads;

    for (int i = 0; i < numThreads; i++) {
        threads.emplace_back(sieveThread, ref(sieve), ref(passes));
    }
    auto startTime = high_resolution_clock::now();

    this_thread::sleep_for(seconds(5));
    for (auto& thread : threads) {
        thread.detach();
    }

    auto endTime = high_resolution_clock::now();
    auto elapsedTime = duration_cast<duration<double>>(endTime - startTime).count();

    for (int i = 2; i <= limit; i++) {
        if (sieve[i]) {
            count++;
        }
    }
    cout << "Time: " << elapsedTime << "s" << endl;
    cout << "Passes: " << passes << endl;
    cout << "Prime numbers found: " << count << endl;

    return 0;
}

Commented to thread : codewars but code any language


@B00M yes loll

Replied to thread : codewars but code any language


@B00M goto the new challenge

Created a new thread : CodeWars V2 in any language


make a program which will get how many prime numbers there are in 1 million then keep doing that for 5 seconds give or take a few miliseconds and then list how many times it was able to do that.

Rules
you can only use the Sieve of eratosthenes algorihim
multithreading is allowed but limited to 32 threads
you must show how long it took and how many passes in the console

Good Luck my fellow coders!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Replied to thread : Codewars but rewrite my code to make it faster in any language!


https://media.discordapp.net/attachments/980907747031789638/1121158601600409720/image.png

Created a new thread : Codewars but rewrite my code to make it faster in any language!


do what ze title says
rules.
your not allowed to change the main function of the code you can only try to remake or optimise it to be faster

using System;
using System.Collections.Generic;
using System.Diagnostics;

public class FibonacciSequence
{
    private static Dictionary<int, int> fibCache = new Dictionary<int, int>();

    public static void Main(string[] args)
    {
        long totalTime = 0;
        int iterations = 100;
        for (int i = 0; i < iterations; i++)
        {
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            for (int e = 0; e < 10000; e++)
            {
                int fibonacciNumber = Fibonacci(e);
                Console.Write(fibonacciNumber + " ");
            }
            stopwatch.Stop();

            totalTime += stopwatch.ElapsedMilliseconds;
        }
        double averageTime = (double)totalTime / iterations;

        Console.WriteLine("\n \n Average time: " + averageTime + " ms");
        Console.WriteLine("Total time " + totalTime / 1000 + " Seconds");

        Console.ReadLine();
    }

    public static int Fibonacci(int n)
    {
        if (fibCache.ContainsKey(n))
        {
            return fibCache[n];
        }

        int fibonacciNumber;
        if (n <= 1)
        {
            fibonacciNumber = n;
        }
        else
        {
            fibonacciNumber = Fibonacci(n - 1) + Fibonacci(n - 2);
        }

        fibCache[n] = fibonacciNumber;
        return fibonacciNumber;
    }
}

Commented to thread : codewars but code any language


@Alawrpar embed fail

https://cdn.discordapp.com/attachments/1064359813175328891/1121133416411316344/image.png

Replied to thread : codewars but code any language


@SeizureSalad fak you, anyways @Alawrpar

 

 

https://cdn.discordapp.com/attachments/980907747031789638/1121122448314749099/image.png

#include <iostream>
#include <vector>
#include <cmath>
#include <chrono>
#include <omp.h>

int countPrimeNumbers(int limit)
{
    std::vector<char> isComposite(limit + 1, false);
    int sqrtLimit = static_cast<int>(std::sqrt(limit));

#pragma omp parallel for schedule(dynamic)
    for (int number = 2; number <= sqrtLimit; number++)
    {
        if (!isComposite[number])
        {
            for (int multiple = number * number; multiple <= limit; multiple += (2 * number))
            {
                isComposite[multiple] = true;
            }
        }
    }

    int primeCount = 1;
#pragma omp parallel for schedule(guided) reduction(+: primeCount)
    for (int number = 3; number <= limit; number += 2)
    {
        if (!isComposite[number])
        {
            primeCount++;
        }
    }

    return primeCount;
}

int main()
{
    const int iterations = 1000;
    const int limit = 1000000;

    long long totalTime = 0;
    int primeCount = 0;

    omp_set_nested(true);

    for (int i = 0; i < iterations; i++)
    {
        auto startTime = std::chrono::high_resolution_clock::now();

        primeCount = countPrimeNumbers(limit);

        auto endTime = std::chrono::high_resolution_clock::now();
        auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count();
        totalTime += elapsedTime;
    }

    double averageTime = static_cast<double>(totalTime) / iterations;

    std::cout << "Average time: " << averageTime << " ms" << std::endl;
    std::cout << "Prime numbers found: " << primeCount << std::endl;

    return 0;
}

Replied to thread : codewars but code any language


@Alawrpar i have found a way to beat your score :)