commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import math
|
||||
|
||||
n, c = map(int, input().split())
|
||||
a = [int(input()) for _ in range(n)]
|
||||
|
||||
packs = math.ceil(sum(a) / 10)
|
||||
print(packs * c)
|
||||
@@ -0,0 +1,5 @@
|
||||
4 6
|
||||
15
|
||||
8
|
||||
31
|
||||
42
|
||||
@@ -0,0 +1,18 @@
|
||||
n = int(input())
|
||||
f = [input() for _ in range(n)]
|
||||
# Continue your code here and print your final answer!
|
||||
counts = {}
|
||||
for l in f:
|
||||
if l in counts:
|
||||
counts[l] += 1
|
||||
else:
|
||||
counts[l] = 1
|
||||
|
||||
mk = ""
|
||||
ma = -1
|
||||
for k in counts:
|
||||
if counts[k] > ma or (counts[k] == ma and k < mk):
|
||||
mk = k
|
||||
ma = counts[k]
|
||||
|
||||
print(mk)
|
||||
@@ -0,0 +1,11 @@
|
||||
10
|
||||
japan
|
||||
hongkong
|
||||
japan
|
||||
hongkong
|
||||
france
|
||||
germany
|
||||
france
|
||||
germany
|
||||
japan
|
||||
japan
|
||||
@@ -0,0 +1,8 @@
|
||||
7
|
||||
hisss
|
||||
triiilll
|
||||
buuurrrbllle
|
||||
his
|
||||
trlll
|
||||
burbble
|
||||
hello
|
||||
@@ -0,0 +1,21 @@
|
||||
import re
|
||||
|
||||
t = int(input())
|
||||
a = [input() for _ in range(t)]
|
||||
# Continue your code here and print your final answer!
|
||||
patterns = {
|
||||
"hiss": re.compile("^hiss+$"),
|
||||
"trill": re.compile("^tri+ll+$"),
|
||||
"burble": re.compile("^bu+r+bl+e$"),
|
||||
}
|
||||
|
||||
|
||||
for line in a:
|
||||
found = False
|
||||
for name in patterns:
|
||||
if patterns[name].match(line):
|
||||
print(name)
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print("human noises")
|
||||
@@ -0,0 +1,14 @@
|
||||
n = int(input())
|
||||
s = input()
|
||||
# Continue your code here and print your final answer!
|
||||
|
||||
odd_evens = [ord(c) % 2 for c in list(s)]
|
||||
odd = 0
|
||||
even = 0
|
||||
for x in odd_evens:
|
||||
if x == 1:
|
||||
odd += 1
|
||||
else:
|
||||
even += 1
|
||||
|
||||
print(odd, even)
|
||||
Reference in New Issue
Block a user