Skip to content

Instantly share code, notes, and snippets.

@juliobguedes
Created October 6, 2019 06:52
Show Gist options
  • Save juliobguedes/23500a1e2c1de4e91ecc04a4626d14db to your computer and use it in GitHub Desktop.
Save juliobguedes/23500a1e2c1de4e91ecc04a4626d14db to your computer and use it in GitHub Desktop.
# (C) Júlio Guedes
# ATAL 2019.2
letters = input()
hello = "hello"
pointer = 0
for l in letters:
if pointer < len(hello):
if (l == hello[pointer]):
pointer += 1
if (pointer == len(hello)):
print("YES")
else:
print("NO")
# coding: utf-8
# (C) Júlio Barreto
# Lineland Mail - Codeforces
n = int(raw_input())
c = map(int, raw_input().split())
for city in range(len(c)):
if city == 0:
print abs(c[city + 1] - c[city]), abs(c[-1] - c[city])
elif city == len(c) - 1:
print abs(c[city] - c[city-1]), abs(c[city] - c[0])
else:
mini = min(c[city] - c[city-1], c[city+1] - c[city])
maxi = max(c[-1] - c[city], c[city] - c[0])
print mini, maxi
# coding: utf-8
# (C) Júlio Guedes
# ATAL 2019.2
s = raw_input()
c = 26 * (len(s) + 1) - len(s)
print c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment