This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <algorithm> | |
#include <vector> | |
#include <map> | |
#include <array> | |
#include <fstream> | |
#include <xmmintrin.h> | |
#include <experimental/string_view> | |
using namespace std; | |
using namespace std::experimental; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> using id=T; | |
template<typename T> | |
concept bool A = requires(T a) { a==a; }; | |
template<typename T, typename U> | |
concept bool B = | |
A<T> && // (1) basic usage | |
A<T> && // (2) duplicate concept check | |
A<U> && // (3) different concept check that happens to work on the same type here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, val): | |
self.up = bool(val & 1) | |
self.right = bool(val & 2) | |
self.down = bool(val & 4) | |
self.left = bool(val & 8) | |
def rotate(self): | |
self.up, self.right, self.down, self.left = self.right, self.down, self.left, self.up | |
def num(self): | |
return self.up<<0 | self.right<<1 | self.down<<2 | self.left<<3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// and it works with standard algorithms out of the box | |
#include <algorithm> | |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
struct S{ | |
S(){static int N; val = N++;} | |
void f(){std::cout << " " << val << "\n";} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from marisa_trie import Trie | |
valid_squares = [] | |
def recurse(): | |
for row in row_words: | |
yield from recurse_col((row,), (), 1, 0) | |
def recurse_row(rows, cols, y, x): | |
for i in range(y, H): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14874 | |
0 L 4 992 1 | |
0 D 115 992 1 | |
0 L 4 508 1 | |
0 L 4 1300 1 | |
0 D 838 508 1 | |
0 D 838 1300 1 | |
0 L 0 1087 1 | |
0 L 0 1328 1 | |
0 D 295 1087 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 | |
PAINT_LINE 24 63 24 87 | |
PAINT_LINE 29 113 32 113 | |
PAINT_SQUARE 32 171 1 | |
PAINT_LINE 14 116 23 116 | |
PAINT_SQUARE 19 101 5 | |
PAINT_SQUARE 27 138 2 | |
PAINT_SQUARE 28 60 3 | |
PAINT_LINE 25 191 28 191 | |
PAINT_SQUARE 27 175 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
wh, *macierz = open("logo.in").read().splitlines() | |
wh, *macierz = open("right_angle.in").read().splitlines() | |
wh, *macierz = open("learn_and_teach.in").read().splitlines() | |
H, W = map(int, wh.split()) | |
def banalny(macierz, transponowana=False): | |
if transponowana: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <sstream> | |
#include <arpa/inet.h> | |
#include <endian.h> | |
unsigned to_num(const std::string& ip) { |