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
<!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
case "Телефон:": | |
switch (value) { | |
case "Телефона нет": | |
flat.setPhoneExists(false); | |
return; | |
case "Спаренный": | |
case "Есть телефон": | |
case "Дом каблирован": | |
case "Есть два телефона": | |
flat.setPhoneExists(true); |
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
rs:PRIMARY> use hydra-site-gipernn | |
switched to db hydra-site-gipernn | |
rs:PRIMARY> db.page.count({downloaded:{$gte:ISODate("2015-10-09")}}) | |
14869 | |
rs:PRIMARY> use hydra-site-ch-gipernn | |
switched to db hydra-site-ch-gipernn | |
rs:PRIMARY> db.page.count({downloaded:{$gte:ISODate("2015-10-09")}}) | |
6607 | |
rs:PRIMARY> use hydra-site-nb-gipernn | |
switched to db hydra-site-nb-gipernn |
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
<script> | |
ListingMapController.Init( {"listings":[{"listingId":123637117,"latitude":55.6572,"longitude":37.7635956,"type":0,"prefixedListingId":"l123637117"},{"listingId":123445023,"latitude":55.6517639,"longitude":37.7699356,"type":0,"prefixedListingId":"l123445023"},{"listingId":122832120,"latitude":55.66699,"longitude":37.7635956,"type":0,"prefixedListingId":"l122832120"},{"listingId":123495280,"latitude":55.6677628,"longitude":37.7619247,"type":0,"prefixedListingId":"l123495280"},{"listingId":123675415,"latitude":55.6548958,"longitude":37.7745171,"type":0,"prefixedListingId":"l123675415"},{"listingId":121984459,"latitude":55.65171,"longitude":37.7485657,"type":0,"prefixedListingId":"l121984459"},{"listingId":123260355,"latitude":55.65863,"longitude":37.77213,"type":0,"prefixedListingId":"l123260355"},{"listingId":122040490,"latitude":55.66843,"longitude":37.760334,"type":0,"prefixedListingId":"l122040490"},{"listingId":122351301,"latitude":55.65768,"longitude":37.7676468,"type":0,"prefixedListingId":"l |
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 |
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
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
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): |
OlderNewer