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 collections import Counter | |
M, N = [int(i) for i in input().split()] | |
members = Counter() | |
for _ in range(M): | |
member = input() | |
members[member] += 1 | |
members = list(filter(lambda x: x[1] >= N, members.most_common())) | |
members = sorted(members, key=lambda x: (-x[1], x[0])) | |
if members: | |
for member in members: |
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, s = map(int, input().split()) | |
def dfs(graph, start, visited=set()): | |
if start not in visited: | |
visited.add(start) | |
for node in graph[start]: | |
dfs(graph, node, visited) | |
return visited | |
graph = dict() | |
for i in range(n): | |
graph[i+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
s, p = map(int, input().split()) | |
res = 'NO SOLUTION' | |
for x in range(10001): | |
y = s - x | |
if x * y == p: | |
x, y = sorted([x, y]) | |
res = '{} {}'.format(x, y) | |
print(res) |
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, k = map(int, input().split()) | |
table = [[True]*n, [False]*n] | |
for i in range(2, n + 1): | |
table.append([]) | |
for j in range(n): | |
temp = True | |
m = i if (j + 2) > i else (j + 2) | |
for s in range(m): | |
temp &= table[i-s-1][s] | |
table[i].append(not temp) |
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/bin/python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
def WPSchecksum(pin): | |
''' | |
Standard WPS checksum algorithm. | |
@pin — A 7 digit pin to calculate the checksum for. | |
Returns the checksum value. | |
''' |
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/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from hashlib import pbkdf2_hmac, sha1 | |
import hmac | |
import subprocess | |
essid = input('ESSID: ') | |
passphrase = input('Passphrase: ') | |
bssid = input('BSSID: ').lower().replace(':', '').replace('-', '').replace('.', '') | |
sta_mac = input('Client MAC: ').lower().replace(':', '').replace('-', '').replace('.', '') |
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 argparse | |
import csv | |
from datetime import datetime | |
if __name__ == '__main__': | |
table_header = ['IP Address', 'Port', 'Time (ms)', 'Status', | |
'Authorization', 'Server name / Realm name / Device type', | |
'Radio Off', 'Hidden', 'BSSID', 'ESSID', 'Security', | |
'Key', 'WPS PIN', 'LAN IP Address', 'LAN Subnet Mask', | |
'WAN IP Address', 'WAN Subnet Mask', 'WAN Gateway', |
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 | |
import os | |
import csv | |
try: | |
core_file = sys.argv[1] | |
except IndexError: | |
print('Использование: {} файлназначения.csv'.format(sys.argv[0])) | |
exit(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 strutils import parseInt, split, join | |
let n = uint8(parseInt(readLine(stdin))) | |
var x_roads_asphalted: seq[uint8] | |
var y_roads_asphalted: seq[uint8] | |
var days: seq[uint8] | |
var counter: uint8 = 1 | |
for i in uint8(1)..(n * n): | |
let t = split(readLine(stdin), ' ') | |
var x_road = uint8(parseInt(t[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
# -*- coding: utf-8 -*- | |
def checksum(pin): | |
''' | |
Standard WPS checksum algorithm. | |
@pin — A 7 digit pin to calculate the checksum for. | |
Returns the checksum value. | |
''' | |
accum = 0 | |
while pin: | |
accum += (3 * (pin % 10)) |
OlderNewer