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 itertools import chain, permutations | |
n1 = input() | |
n2 = input() | |
n3 = input() | |
str_nums = [] | |
str_nums.append(n1), str_nums.append(n2), str_nums.append(n3) | |
divider = int(n1) + int(n2) + int(n3) | |
is_successful = False |
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
''' | |
2. Crocs | |
draw | |
width – N * 5 | |
height – N * 4 + 2 | |
header rows = int(N / 2) | |
Input |
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
''' | |
The rules: | |
Two teams, named "A" and "B" have 11 players each. | |
The players on each team are numbered from 1 to 11. | |
Any player may be sent off the field by being given a red card. | |
If one of the teams has less than 7 players remaining, the game is stopped immediately by the referee, | |
and the team with less than 7 players loses. | |
A card is a string with the team's letter ('A' or 'B') followed by a single dash and player's number. | |
e.g. the card 'B-7' means player #7 from team B received a card. (index 6 of the list) |
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
str_in = map(str, input().split()) | |
max_players = 11 | |
team_a = [] | |
team_b = [] | |
for player in range(1, max_players + 1): | |
team_a.append(str(player)) | |
team_b.append(str(player)) |
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
def foo_palindromic_check(str_in): | |
for number in str_in: | |
is_palindromic = [number[i - 1] for i in range(1, int(len(number) / 2) + 1)] ==\ | |
[number[-i2] for i2 in range(1, int(len(number) / 2) + 1)] | |
print(is_palindromic) | |
string_in = input().split(', ') | |
foo_palindromic_check(string_in) |
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
def box_area_foo(a, b, c): | |
return (a * b) * c | |
def sheets_area_foo(all_sheets, one_sheet_covering): | |
osf_sheets_count = int(all_sheets / 3) # osf = one slash four | |
sheets_count = int(all_sheets - osf_sheets_count) | |
osf_sheets_covering = (osf_sheets_count * one_sheet_covering) / 4 | |
sheets_covering = sheets_count * one_sheet_covering | |
all_sheets_covering_in_cm = osf_sheets_covering + sheets_covering |
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
# def exchange(li, operator_value): | |
# max_index = 0 | |
# for i in range(len(li)): | |
# max_index = i | |
# | |
# if operator_value > max_index: | |
# print('Invalid index') | |
# else: | |
# for i in range(1, operator_value + 2): | |
# temp = li.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
def permute(nums): | |
result_perms = [[]] | |
for num in nums: | |
new_perms = [] | |
for perm in result_perms: | |
for i in range(len(perm) + 1): | |
new_perms.append(perm[:i] + [num] + perm[i:]) | |
result_perms = new_perms | |
return reversed(result_perms) |
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 itertools import chain, permutations | |
n1 = input() | |
n2 = input() | |
n3 = input() | |
str_nums = [] | |
str_nums.append(n1), str_nums.append(n2), str_nums.append(n3) | |
divider = int(n1) + int(n2) + int(n3) | |
is_successful = False |
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
targets_list = list(map(int, input().split("|"))) | |
points = 0 | |
while True: | |
operations = input() | |
if "Game over" in operations: | |
print(" - ".join(str(targets_list).split(', '))[1:-1]) | |
print(f'Iskren finished the archery tournament with {points} points!') | |
break |