Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / booking.css
Created June 15, 2025 06:55
Booking Style CSS
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@thinkphp
thinkphp / chicken-and-fox.c
Created June 14, 2025 18:45
Chicken-and-fox.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_ANIMALS 100
void generatePermutations(char* animals, int size, char result[][MAX_ANIMALS], int *count);
void swap(char*a, char *b);
void permute(char *arr, int start, int end, char result[][MAX_ANIMALS], int* count, int size);
void writeResultsToFile() {
@thinkphp
thinkphp / shortest-path-BFS.c
Created June 14, 2025 17:58
shortest-path-BFS.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_VERTICES 100
#define MAX_QUEUE_SIZE 100
//structura pentru elementele din coada
typedef struct {
int vertex;
int distance;
@thinkphp
thinkphp / Telecommunication-rivalitati.c
Created June 14, 2025 17:17
Telecommunications Rivalitati
/*
test case 1:
4
0 0 0 1
0 0 1 0
0 1 0 0
1 0 0 0
test case 2:
@thinkphp
thinkphp / asymmetrical.c
Last active June 14, 2025 16:04
asymmetrical.c
/*
Algoritmul pentru verificarea grafului asimetric
Conceptul de baza:
Un graf orientat este asimetric daca nu exista perechi simetrice de muchii. Adica, daca
exista o muchie de la nodul A la nodul B , nu trebuie sa existe o muchie de la nodul B la nodul A
@thinkphp
thinkphp / domino.c
Created June 13, 2025 18:40
problema 3. domino pieces
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct {
int x1,
x2;
} Domino;
@thinkphp
thinkphp / connectedNode.c
Created June 13, 2025 17:53
probleme 2 . Connected Nodes
#include <stdio.h>
#include <malloc.h>
void DFSHelper(int **graph, int node, int n, int *visited, int * connectedNodes, int *count) {
visited[ node ] = 1;
connectedNodes[ (*count)++ ] = node;
for(int neighbor = 0; neighbor < n; neighbor++) {
@thinkphp
thinkphp / matrix_div_k.c
Created June 13, 2025 17:03
matrix_div_k.c
#include <stdio.h>
#include <malloc.h>
int sumDivisibleRecursiveAlt(int **matrix, int k, int index, int n) {
if(index >= n * n) {
return 0;
}
@thinkphp
thinkphp / matrix_div_k.cpp
Last active June 13, 2025 16:33
matrix_div_k.cpp
#include <iostream>
#include <vector>
using namespace std;
int sumDivisibleRecursive(vector<vector<int>> &matrix, int k, int row, int col, int n) {
if(row >= n) {
return 0;
@thinkphp
thinkphp / AIScheduler.md
Last active June 13, 2025 10:39
AIScheduler.md

AIScheduler

Am dezvoltat AI Scheduler pentru a rezolva problema complexa de planificare a turelor, folosind algoritmi genetici. Aplicatia optimizeaza automat programul unei echipe, respectand constrangeri precum disponibilitatea individuala si necesitatile operationale. Algoritmul evolueaza solutii prin selectie naturala, crossover si mutatie, gasind echilibrul optim între satisfactia angajatilor si eficienta operationala

1. Aplicare Practica a Algoritmilor Genetici

  • Cromozom: Matrice 7x10 (zile x angajați) cu 1/0 pentru lucru/liber
  • Fitness Function: Penalizări inteligente pentru încălcarea constrângerilor
  • Operatori Genetici: Crossover pe angajați, mutație controlată, selecție tournament
  • Elitism: Păstrează cele mai bune soluții între generații