AtCoder ABC187 Python

A.py


A, B = map(str, input().split())

a = list(map(int, A))
b = list(map(int, B))

suma = sum(a)
sumb = sum(b)

if suma >= sumb:
    print(suma)
else:
    print(sumb)

B.py


N = int(input())
ab = [map(int, input().split()) for _ in range(N)]
a, b = [list(i) for i in zip(*ab)]

ans = 0

for i in range(N):
    ai = a[i]
    bi = b[i]
    for j in range(i+1, N):
        aj = a[j]
        bj = b[j]
        m = (bj-bi)/(aj-ai)
        if m >= -1 and m <= 1:
            ans += 1
print(ans)

C.py


N = int(input())
S = list(input() for i in range(N))

# print(S)

s1 = []
s2 = []

for s in S:
    if s[0] == '!':
        s2.append(s[1:])
    else:
        s1.append(s)

# print(s1, s2)
s1 = list(set(s1))
s2 = list(set(s2))

l = [k for k, v in Counter(s1 + s2).items() if v > 1]

if l == []:
    print('satisfiable')
else:
    print(l[0])

D.py


N = int(input())
X = 0
x = []
for i in range(N):
    A, B = map(int, input().split())
    X -= A
    x.append(2*A + B)
print(X)
x.sort()
print(x)
ans = 0
while X <= 0:
    X += x.pop()
    ans += 1

print(ans)

Recommended Posts

AtCoder ABC 174 Python
AtCoder ABC187 Python
AtCoder ABC188 Python
AtCoder ABC 175 Python
atCoder 173 Python
AtCoder ABC176
AtCoder ABC177
AtCoder ABC 177 Python (A ~ E)
Solve AtCoder ABC166 with python
AtCoder ABC 178 Python (A ~ E)
Atcoder ABC164 A-C in Python
AtCoder ABC 176 Python (A ~ E)
Atcoder ABC167 A-D in Python
Atcoder ABC165 A-D in Python
Atcoder ABC166 A-E in Python
AtCoder ABC 182 Python (A ~ D)
Solve AtCoder ABC 186 with Python
Atcoder ABC169 A-E in Python
AtCoder ABC177 A-D in python
Beginner ABC154 (Python)
Solve Atcoder ABC169 A-D in Python
Beginner ABC155 (Python)
Solved AtCoder ABC 114 C-755 with Python3
Template AtCoder ABC 179 Python (A ~ E)
Beginner ABC157 (Python)
Python beginner Atcoder memo @ KEYENCE 2020, ABC problem
[AtCoder] Solve ABC1 ~ 100 A problem with Python
Solve AtCoder ABC168 with python (A ~ D)
Daily AtCoder # 36 in Python
Daily AtCoder # 2 in Python
Daily AtCoder # 32 in Python
Daily AtCoder # 6 in Python
Daily AtCoder # 18 in Python
Daily AtCoder # 53 in Python
Daily AtCoder # 33 in Python
Daily AtCoder # 7 in Python
Daily AtCoder # 24 in Python
Daily AtCoder # 37 in Python
Solve AtCoder 167 with python
Daily AtCoder # 42 in Python
Daily AtCoder # 21 in Python
Daily AtCoder # 17 in Python
Daily AtCoder # 38 in Python
Daily AtCoder # 54 in Python
Daily AtCoder # 11 in Python
Daily AtCoder # 15 in Python
Daily AtCoder # 47 in Python
Daily AtCoder # 13 in Python
Daily AtCoder # 30 in Python
Daily AtCoder # 40 in Python
Daily AtCoder # 10 in Python
Daily AtCoder # 5 in Python
Daily AtCoder # 28 in Python
Daily AtCoder # 39 in Python
Automate AtCoder submission (Python)
Atcoder ABC115 Past Exercises
Daily AtCoder # 20 in Python
Daily AtCoder # 19 in Python
Daily AtCoder # 52 in Python
Daily AtCoder # 3 in Python
Daily AtCoder # 14 in Python