Compare commits
3 Commits
4bc8d64e38
...
fb8cf978a0
| Author | SHA1 | Date | |
|---|---|---|---|
| fb8cf978a0 | |||
| 3dd1f0a732 | |||
| eccd02fbbc |
16
cups.py
Normal file
16
cups.py
Normal file
@@ -0,0 +1,16 @@
|
||||
n = int(input())
|
||||
|
||||
cups = {}
|
||||
for _ in range(n):
|
||||
tokens = input().split()
|
||||
try:
|
||||
value = int(tokens[0]) / 2
|
||||
color = tokens[1]
|
||||
except ValueError:
|
||||
value = int(tokens[1])
|
||||
color = tokens[0]
|
||||
cups[color] = value
|
||||
|
||||
vals = sorted(cups.values())
|
||||
for val in vals:
|
||||
print(list(cups.keys())[list(cups.values()).index(val)])
|
||||
18
symmetricorder.py
Normal file
18
symmetricorder.py
Normal file
@@ -0,0 +1,18 @@
|
||||
n = int(input())
|
||||
setnr = 1
|
||||
|
||||
while n:
|
||||
names = []
|
||||
for _ in range(n):
|
||||
names.append(input())
|
||||
|
||||
names_even = [name for i, name in enumerate(names) if i % 2 == 0]
|
||||
names_odd = [name for i, name in enumerate(names) if i % 2 == 1][::-1]
|
||||
names = names_even + names_odd
|
||||
|
||||
print(f"SET {setnr}")
|
||||
for name in names:
|
||||
print(name)
|
||||
|
||||
n = int(input())
|
||||
setnr += 1
|
||||
19
taisformula.py
Normal file
19
taisformula.py
Normal file
@@ -0,0 +1,19 @@
|
||||
n = int(input())
|
||||
prev_t = 0
|
||||
prev_v = 0
|
||||
total = 0
|
||||
for i in range(n):
|
||||
m = input().split()
|
||||
t = int(m[0])
|
||||
v = float(m[1])
|
||||
|
||||
if prev_t == 0:
|
||||
prev_t = t
|
||||
prev_v = v
|
||||
continue
|
||||
|
||||
total += ((prev_v + v) / 2) * (t - prev_t) / 1000
|
||||
prev_t = t
|
||||
prev_v = v
|
||||
|
||||
print(total)
|
||||
Reference in New Issue
Block a user