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
//! Algorithm for solving problems of the following kind. | |
//! | |
//! Given: `significance` ratio, empirical sample, theoretical sample. | |
//! To figure out: Is it appropriate to assume that the sample is a sample of a Normal Distribution? | |
use statrs::distribution::{ChiSquared, ContinuousCDF}; | |
fn main() { | |
let e: Vec<_> = [7, 12, 49, 66, 83, 67, 23, 13] | |
.iter() |
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
digraph Automata { | |
// Default parameters for all nodes and edges. | |
node [shape=circle fontname="Arial"]; | |
edge [fontname="Arial"] | |
{rank=same 2 3} | |
// Identifier. | |
S -> 2 [label=" a...z0...9"] | |
2 -> 2 [label=" a...z0...9"] | |
2 -> 3 [label=" ["] |
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 <iostream> | |
#include <string> | |
static int calculate(int a, int b, int c, int d) | |
{ | |
int result = 0; | |
// (4*a + 52 - 9*b) / (c - 84/(d*a)) | |
__asm { | |
; a * 4 |
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
/* | |
Advent of Code 2023. Challenge 2. | |
*/ | |
use regex; | |
use std::fs::read_to_string; | |
const RED: usize = 12; | |
const GREEN: usize = 13; | |
const BLUE: usize = 14; |
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
from random import randint | |
def print_info(): | |
information = \ | |
""" | |
Лабораторная работа № 2 | |
Вариант № 20. Выполнил студент группы 6104-020302D Стародубцев Виктор | |
1. В списке целочисленных элементов найти максимальный нечётный элемент | |
2. С использованием цикла `while` найти в списке индекс последнего |
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
# Problem No. 8432 on https://www.kompege.ru | |
class Vehicle: | |
''' | |
Kind of struct describing a vehicle. | |
''' | |
def __init__(self, start: int, duration: int, _type: str): | |
self.start = start | |
self.end = start + duration |
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
# Problem No. 7709 on https://www.kompege.ru | |
def does_not_intercept(pair_a: tuple[int, int], pair_b: tuple[int, int]) -> bool: | |
return all(x < pair_b[0] for x in pair_a) or all(x > pair_b[1] for x in pair_a) | |
with open('26_7709.txt') as file: | |
rows = file.readlines() | |
K = int(rows[0]) |
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
with open('26-101.txt') as file: | |
rows = file.readlines() | |
N, K = tuple(int(x) for x in rows[0].split()) | |
crates = sorted((int(x) for x in rows[1:]), reverse=True) | |
blocks = list() | |
while crates: | |
block = [crates.pop(0)] |
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
with open('26-100.txt') as file: | |
rows = file.readlines() | |
N, M = tuple(int(x) for x in rows[0].split()) | |
pipes = sorted(int(x) for x in rows[1:]) | |
for i in range(N): | |
pipeline = [pipes[i]] |
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
""" | |
Solution to the problem No. 4322 by /dev/inf from kompege.ru | |
`10.txt` is a text file in which the beginning and each line of type `Глава \d+` | |
must be deleted manually in the Notebook for example. | |
""" | |
import re | |
NewerOlder