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 math | |
values = {} | |
N = 0 | |
while True: | |
inpt = input() | |
if inpt == 'stop': | |
break | |
N += 1 | |
inpt = float(inpt) |
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 <stdio.h> | |
#include <inttypes.h> | |
int main(int argc, char *argv[]) | |
{ | |
uint_fast16_t N, count = 0; | |
scanf("%" SCNuFAST16, &N); | |
uint_fast16_t cur_cap = 1, following = 10; | |
/* cur_cap - текущая разрядность числа | |
following - первое число большей разрядности */ |
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
game=test | |
love_win=./.love_win | |
love_linux=./.love_linux | |
$(game): clean dirs love linux windows | |
.PHONY: clean dirs | |
clean: | |
-rm -r build | |
dirs: |
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
def vigenere(msg, key, crypt_flag=True): | |
""" | |
vigenere cipher for small latin letters | |
crypt_flag == True mean crypt | |
crypt_flag == False mean decrypt | |
""" | |
msg, key = list(map(ord, msg)), list(map(ord, key)) | |
msglen, keylen = len(msg), len(key) | |
new_msg = '' | |
for i in range(msglen): |
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 <stdio.h> | |
#include <inttypes.h> | |
#define N 100000 | |
uint_fast16_t f() | |
{ | |
static uint_fast16_t last = 0, indxs[N] = {0}, i = 0; | |
i++; | |
uint_fast16_t tmp = last; |
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 sys | |
from PIL import Image | |
import numpy as np | |
import colorsys as cs | |
im = Image.open(sys.argv[1]).convert('RGB') | |
rgb_array = np.array(im) | |
shape = rgb_array.shape |
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 numpy | |
import sys | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
def get_rgb(r: int, g: int, b: int): | |
if 0 <= r <= 255 and 0 <= g <= 255 and 0 <= b <= 255: | |
return '#%02x%02x%02x' % (r, g, b) |
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
P=monty | |
OBJECTS= | |
CFLAGS = -g -Iinclude -Wall `pkg-config --cflags libsodium` | |
LDLIBS= `pkg-config --libs libsodium` | |
CC=cc | |
$(P): $(OBJECTS) | |
clean: | |
-rm $(OBJECTS) $(P) |
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 random | |
def selection_sort(a: list): | |
length = len(a) | |
for i in range(length): | |
current_min_i = i | |
current_min = a[i] | |
for j in range(i + 1, length): | |
if a[j] < current_min: | |
current_min = a[j] |
NewerOlder