This commit is contained in:
Justin Lin
2026-05-02 15:42:52 +10:00
commit 8582780ac9
38 changed files with 460 additions and 0 deletions
+7
View File
@@ -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)
+5
View File
@@ -0,0 +1,5 @@
4 6
15
8
31
42
+18
View File
@@ -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)
+11
View File
@@ -0,0 +1,11 @@
10
japan
hongkong
japan
hongkong
france
germany
france
germany
japan
japan
+8
View File
@@ -0,0 +1,8 @@
7
hisss
triiilll
buuurrrbllle
his
trlll
burbble
hello
+21
View File
@@ -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")
+14
View File
@@ -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)