Skip to content

Instantly share code, notes, and snippets.

View Acarus's full-sized avatar

Oleh Klishch Acarus

View GitHub Profile
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
const int INF = 99999999;
void BellmanFord(vector<pair<int, pair<int, int> > >& g, vector<int>& d, int n, int k) {
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool had_circle(const vector<vector<int>>&, vector<char>&, int);
bool t_sort(const vector<vector<int>>&, vector<int>&, vector<char>&, int);
void find_strong_linked_components(const vector<vector<int>>&, vector<int>&, vector<char>& used, int);
@Override
public boolean removeAll(Collection<?> c) {
for(Object item: c) {
int index = indexOf(item);
while(index >= 0) {
remove(index);
index = indexOf(item);
}
}
@Acarus
Acarus / gist:5ea63be5c9ac3afca28e
Last active August 29, 2015 14:22
Discrete Mathematics. Laboratory work №8.
#include <iostream>
#include <stdio.h>
#include <vector>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <algorithm>
using namespace std;
@Acarus
Acarus / gist:618c83316779b43abdde
Last active August 29, 2015 14:22
Discrete Mathematics. Laboratory work №7.
#include <vector>
#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
vector< vector<int> > g, gm;
vector< int > cc;
vector< int> ans;
public void testPrint() {
Stack s1 = new Stack();
s1.push(root);
int emptyLeaf = 32;
boolean isRowEmpty = false;
while(isRowEmpty == false) {
Stack s2 = new Stack();
isRowEmpty = true;
#include <bits/stdc++.h>
using namespace std;
struct Node {
int key;
double prior;
int height;
Node* left;
Node* right;
@Acarus
Acarus / .cpp
Last active August 26, 2015 21:53
Sudoku input data generator
#include <iostream>
#include <ctime>
#include <stdlib.h>
#include <vector>
using namespace std;
class Solution {
@Acarus
Acarus / gist:7ef2a7d7e6c7b9ed1016
Last active September 13, 2015 16:41
Divide set into two subset with minimum sum difference
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main(void) {
ios::sync_with_stdio(false);
int n;
@Acarus
Acarus / autocomplete.html
Created October 24, 2015 17:42
checkpoint autocomplete
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
</head>
<body>
<input id="searchTextField" type="text" size="50">
<script>
function initialize() {