This file contains hidden or 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 random | |
import collections | |
import operator | |
import itertools | |
random.seed() | |
l = [random.randint(1, 18) for i in range(8)] | |
#l = [4, 8, 18, 18, 10, 3, 11, 18] | |
print(*l) |
This file contains hidden or 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 random | |
import operator | |
random.seed() | |
A, B, N = map(int, input().split()) | |
# заполняем список случайными числами: | |
l = [random.randint(A, B) for i in range(N)] | |
# сортируем по неубыванию, возвращая список пар чисел (индекс, число) | |
m = sorted(enumerate(l), key=operator.itemgetter(1)) | |
# создаём список дистанций между отсортированными числами |
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"strings" |
This file contains hidden or 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
package main | |
import ( | |
"math" | |
"time" | |
"fmt" | |
) | |
type Point struct { | |
x float64 |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#include <linux/if_packet.h> | |
#include <linux/if_ether.h> | |
// #include <netpacket/packet.h> |
This file contains hidden or 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
set nocompatible | |
autocmd FileType python set expandtab | |
syntax on | |
" set number | |
set tabstop=4 | |
set autoindent | |
set shiftwidth=4 | |
" set cursorline | |
set showmatch |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import datetime as dt | |
SECRET_KEY = """ Ключ можно получить здесь: https://tech.yandex.ru/rasp/raspapi/ """ | |
p = {"Белорусский вокзал": "s2000006", | |
"Шереметьево": "s9600213" |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import zlib | |
def main(): | |
with open(sys.argv[1], 'rb') as f: | |
data = f.read() | |
print(hex(zlib.crc32(data))) |
This file contains hidden or 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 mmap | |
import winsound as ws | |
import struct as st | |
from math import sin, cos, radians | |
from random import randint | |
# in RIFF format (and therefore in WAVE) ALL NUMBERS ARE LITTLE ENDIAN | |
FILE_SIZE = 44100*10+44 # bytes |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import datetime as dt | |
SECRET_KEY = "get it yourself @ yandex" | |
p = { "Одинцово" : "s9600721", | |
"Голицыно": "s9602265", |