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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Испытание: формы — вспомнить всё</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<form action="/echo" method="post"> | |
<label for="name-field">Имя</label> | |
<input type="text" id="name-field" name="name"> |
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
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
import codecs | |
import re | |
def read_file(fileName): | |
f = codecs.open(fileName,'r','utf8') | |
source_text = f.read() | |
f.close() |
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
#n = 10 | |
#t1, t2 = 1, 2 | |
#a, b, c, d = 0, 1, 1, 11 | |
f = open('treasure.in', 'r') | |
n = int(f.readline()) | |
t1, t2 = list(map(int, f.readline().split(" "))) | |
a, b, c, d = list(map(int, f.readline().split(" "))) | |
f.close() |
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 isAnswer(left_border, sum, mid): | |
flint = sum[mid] - sum[left_border-1] | |
bengann = (sum[len(sum)-1] - sum[0]) - flint | |
#print(left_border, mid, flint >= bengann, flint-bengann) # с этой функцией всё ок | |
return flint >= bengann | |
def find(left_border, sum): | |
l = left_border #ок | |
r = len(sum)-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
from random import * | |
def find_first(array, element): #[l, r) first entry element | |
l = -1 | |
r = len(array) | |
while l + 1 < r: | |
m = (l + r)//2 | |
if array[m] >= element: | |
r = m |
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 isAnswer(m, n, x, y): | |
return (m//x) + (m//y) >= n | |
def find(n, x, y): | |
l = 0 | |
r = n * x | |
while l + 1 < r: | |
m = (l + r)//2 | |
if isAnswer(m, n, x, y): |
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 isAnswer(w, h, n, m): | |
return (m//w) * (m//h) >= n | |
def find(w, h, n): | |
l = 0 | |
r = 10**18 | |
while l + 1 < r: | |
m = (l + r)//2 | |
if isAnswer(w, h, n, m): |
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 isAnswer(array, k, checked): | |
last = -1 | |
count = 0 | |
for i in range(len(array)): | |
if last == -1 or array[i] - array[last] >= checked: | |
count += 1 | |
last = i | |
return count >= k | |
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
#Задача B. Наименьший нечетный | |
# ok 1) если все элементы в массиве чётные - выведи 0 | |
# ok 2) вывести наименьшее нечётное | |
a = list(map(int, input().split())) | |
a = [0, 4, 5, 1, 7, 3] | |
counter = 0 |
NewerOlder