Kaynağa Gözat

kollontai

master
Roderic Day 3 yıl önce
ebeveyn
işleme
fe4ae68e11
2 değiştirilmiş dosya ile 17 ekleme ve 0 silme
  1. +7
    -0
      y2015/p23.py
  2. +10
    -0
      y2021/p02.py

+ 7
- 0
y2015/p23.py Dosyayı Görüntüle

@@ -0,0 +1,7 @@
insts = text.splitlines()

i = 0:
while i < len(lines):
inst[i]
i += 1


+ 10
- 0
y2021/p02.py Dosyayı Görüntüle

@@ -0,0 +1,10 @@
s1 = 0
s2, aim = 0, 0
for line in text.splitlines():
k, v = line.split()
ds = {'forward': 1, 'down': 1j, 'up': -1j}[k] * int(v)
s1 += ds
aim += ds.imag
s2 += ds.real + aim * ds.real * 1j
ans1 = int(s1.real * s1.imag)
ans2 = int(s2.real * s2.imag)

Yükleniyor…
İptal
Kaydet