From 0c7c64e3415604d9b989247e7bdbb852f70e7ce4 Mon Sep 17 00:00:00 2001 From: ceciliakemiac Date: Tue, 15 Oct 2019 22:42:22 -0300 Subject: [PATCH 1/4] city day --- Codeforces/city_day.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Codeforces/city_day.py diff --git a/Codeforces/city_day.py b/Codeforces/city_day.py new file mode 100644 index 0000000..c281b35 --- /dev/null +++ b/Codeforces/city_day.py @@ -0,0 +1,42 @@ +Problem statement : https://codeforces.com/contest/1199/problem/A + +Solution : + +n, x, y = [int(x) for x in input().split(' ')] +ent = input().split(' ') + +for i in range(n): + ent[i] = int(ent[i]) + +pos = 0 +while True: + resp = 'yeap' + for i in range(x): + if (pos - i - 1) < 0 or pos < 0 or pos > len(ent) - 1: + break + + if ent[pos - i - 1] <= ent[pos]: + resp = 'nope' + break + if resp != 'nope': + for i in range(y): + if (pos + i + 1) > len(ent) - 1 or pos < 0 or pos > len(ent) - 1: + break + + if ent[pos + i + 1] <= ent[pos]: + resp = 'nope' + break + + if resp == 'nope': + pos += 1 + resp = 'yeap' + else: + break + +if pos >= len(ent): + print (pos) +else: + print (pos + 1) + + + From 0fbb0fc3efaa8d939e0ac887f30a8c844c395614 Mon Sep 17 00:00:00 2001 From: ceciliakemiac Date: Tue, 15 Oct 2019 22:44:13 -0300 Subject: [PATCH 2/4] city day --- Codeforces/city_day.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Codeforces/city_day.py b/Codeforces/city_day.py index c281b35..4dc64b7 100644 --- a/Codeforces/city_day.py +++ b/Codeforces/city_day.py @@ -37,6 +37,4 @@ print (pos) else: print (pos + 1) - - - + \ No newline at end of file From 35f6a06775ae8afa704476f5fa62b86b7e769900 Mon Sep 17 00:00:00 2001 From: ceciliakemiac Date: Tue, 15 Oct 2019 22:58:22 -0300 Subject: [PATCH 3/4] keyboard layout solution in python --- Python/keyboard_layouts.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Python/keyboard_layouts.py diff --git a/Python/keyboard_layouts.py b/Python/keyboard_layouts.py new file mode 100644 index 0000000..ccd399a --- /dev/null +++ b/Python/keyboard_layouts.py @@ -0,0 +1,28 @@ +Problem: https://codeforces.com/contest/831/problem/B + +Solution: + +a = raw_input() +b = raw_input() +texto = raw_input() +saida = "" + +for i in range(len(texto)): + if texto[i].isdigit(): + saida += texto[i] + else: + eh_maiuscula = False + if texto[i].isupper(): + x = texto[i].upper() + eh_maiuscula = True + else: + x = texto[i] + for j in range(26): + if a[j] == x.lower(): + if eh_maiuscula: + saida += b[j].upper() + else: + saida += b[j] + break +print saida + From 563e53eb0d1ccdb583729e95b640054888531079 Mon Sep 17 00:00:00 2001 From: ceciliakemiac Date: Tue, 15 Oct 2019 23:00:17 -0300 Subject: [PATCH 4/4] delete file --- Codeforces/city_day.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 Codeforces/city_day.py diff --git a/Codeforces/city_day.py b/Codeforces/city_day.py deleted file mode 100644 index 4dc64b7..0000000 --- a/Codeforces/city_day.py +++ /dev/null @@ -1,40 +0,0 @@ -Problem statement : https://codeforces.com/contest/1199/problem/A - -Solution : - -n, x, y = [int(x) for x in input().split(' ')] -ent = input().split(' ') - -for i in range(n): - ent[i] = int(ent[i]) - -pos = 0 -while True: - resp = 'yeap' - for i in range(x): - if (pos - i - 1) < 0 or pos < 0 or pos > len(ent) - 1: - break - - if ent[pos - i - 1] <= ent[pos]: - resp = 'nope' - break - if resp != 'nope': - for i in range(y): - if (pos + i + 1) > len(ent) - 1 or pos < 0 or pos > len(ent) - 1: - break - - if ent[pos + i + 1] <= ent[pos]: - resp = 'nope' - break - - if resp == 'nope': - pos += 1 - resp = 'yeap' - else: - break - -if pos >= len(ent): - print (pos) -else: - print (pos + 1) - \ No newline at end of file