Skip to content

Instantly share code, notes, and snippets.

View LifeMoroz's full-sized avatar

Galimov Ruslan LifeMoroz

View GitHub Profile
//Все пояснения тут http://ru.wikipedia.org/wiki/Метод_Гаусса_—_Жордана
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <iomanip>
#include "math.h"
using namespace std;
void main()
@LifeMoroz
LifeMoroz / gist:4190396
Created December 2, 2012 18:45
Last lab
#include <iostream>
#include <fstream>
#include "math.h"
#include "windows.h"
#include <iomanip>
#include <conio.h>
#include <stdio.h>
using namespace std;
#include<iostream>
struct Titem{
int n;
Titem *next;
};
void add_item(Titem *last){
Titem *add = new Titem;
add->n=last->n+1;
#include <iostream>
#include <time.h>
int search(int *a, int n, int x)
{
size_t first = 0; /* Номер первого элемента в массиве */
size_t last = n; /* Номер элемента в массиве, СЛЕДУЮЩЕГО ЗА последним */
/* Если просматриваемый участок непустой, first<last */
size_t mid = first + (last - first) / 2;
@LifeMoroz
LifeMoroz / Second.cpp
Last active December 27, 2015 21:09
Second Task
#include <stdio.h>
#include <limits.h>
#include <algorithm>
class Tochka{
public:
int x, y;
Tochka(int x1, int y1){
x = x1;
y = y1;
}
@LifeMoroz
LifeMoroz / 5
Last active December 27, 2015 21:09
All is lost
#include <iostream>
#include <vector>
#include <math.h>
int digit(long long A, long long shift){
return (int)(A / shift)%(sizeof(long long)*8);
}
template<class T>
void count_sort(T *a, T* vtemp, int n, long long shift, int (*dig)(T,T)){
const int digits = sizeof(T) * 8;
std::vector<T> positions(digits);
@LifeMoroz
LifeMoroz / 4rd
Last active December 27, 2015 21:19
Added description
#include <stdio.h>
#include <stdint.h>
#include <algorithm>
#include <vector>
int size = 0;
void Heapify(int* arr, int i) {
int left = 2 * i + 1; int right = 2 * i + 2; // Ищем большего сына, если такой есть.
int largest = i;
if (left < size && arr[left] > arr[i])
@LifeMoroz
LifeMoroz / gist:7453262
Last active December 28, 2015 05:58
Project collapse
#include <stdio.h>
#include <vector>
class Impact;
struct Circle
{
float x, y, r;
};
#include <stdio.h>
using namespace std;
class Node {
private:
int _value;
Node *_left;
Node *_right;
public:
#include <stdio.h>
class Tree {
protected:
class Node {
private:
int _value;