Skip to content

Instantly share code, notes, and snippets.

View stdk's full-sized avatar

Victor stdk

  • Larch Networks
  • Kiev
View GitHub Profile
#include <iterator>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
typedef unsigned long long CaseType;
template<typename T>
const vector<T> read_test_cases(istream& is) {
use std::collections::HashMap;
macro_rules! map {
([$($contents:tt)*] $($parameters:tt)*) => {{
let mut container = HashMap::new();
map!(@parameters container, $($parameters)*);
map!(@contents container, $($contents)*);
container
}};
(@contents $container:expr, $($key:expr => $value:expr),*) => {{
#define __USE_MINGW_ANSI_STDIO 1
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <chrono>
#include <iterator>
#include <functional>
#include <tuple>
#include<netinet/in.h>
#include<errno.h>
#include<netdb.h>
#include<stdio.h> //For standard things
#include<stdlib.h> //malloc
#include<string.h> //strlen
#include<netinet/ip_icmp.h> //Provides declarations for icmp header
#include<netinet/udp.h> //Provides declarations for udp header
#include<netinet/tcp.h> //Provides declarations for tcp header
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <net/if.h>
#include <linux/if_tun.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <net/if.h>
#include <linux/if_tun.h>
template<class Iterator>
struct indirect_iterator {
using iterator_category = typename Iterator::iterator_category;
using value_type = typename Iterator::value_type::value_type;
using difference_type = typename Iterator::difference_type;
using pointer = typename Iterator::value_type::pointer;
using reference = typename Iterator::value_type::reference;
Iterator i;
#!/usr/bin/python
import itertools
DEBUG=False
tokens = ('NODE','NUMBER')
literals = ('|','{','}','[',']','$','=',';','~','.','+')
states = (
('comment','exclusive'),