Skip to content

Instantly share code, notes, and snippets.

View andriiburka's full-sized avatar
☑️
Nope

Andrii Burka andriiburka

☑️
Nope
View GitHub Profile
@andriiburka
andriiburka / 1_softuniada_2019.py
Created January 29, 2020 15:55
90/100 (Runtime Error)
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
@andriiburka
andriiburka / crocs.py
Created January 31, 2020 22:09
0/100
'''
2. Crocs
draw
width – N * 5
height – N * 4 + 2
header rows = int(N / 2)
Input
'''
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)
@andriiburka
andriiburka / 3E_football_cards.py
Created February 3, 2020 16:56
60/100 why???
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))
@andriiburka
andriiburka / 5E_Palindrome_Integers.py
Created February 6, 2020 14:44
Comprehension ver.
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)
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
# 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)
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)
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
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