A. Sweet Problem
for _ in range(int(input())):
t = list(map(int,input().split()))
t.sort()
a,b,c = t
d = c - b
if d < a:
c -= (d + (a-d)//2)
b -= ((a-d) - (a-d)//2)
else:
c -= a
print(a + min(b,c))
B. PIN Codes
for _ in range(int(input())):
N = int(input())
card = {}
t = []
for i in range(N):
q = input()
if q not in card:
card[q] = 1
else:card[q] += 1
t.append(q)
cnt = 0
for i in range(N):
if card[t[i]] == 1:
continue
if card[t[i]] > 1:
card[t[i]] -= 1
cnt += 1
for x in range(4):
flag = False
c = list(t[i])
for y in range(0,10):
c[x] = str(y)
new = ''.join(c)
if new not in card:
card[new] = 1
t[i] = new
flag = True
break
if flag: break
print(cnt)
print(*t,sep='\n')
가독성이..
C. Everyone is a Winner!
from math import sqrt
for _ in range(int(input())):
N = int(input())
ans = set()
ans.add(0)
for i in range(1, int(sqrt(N))+3):
p = N // i
if p:
ans.add(p)
ans.add(N//p)
print(len(ans))
print(*sorted(ans))
D. Secret Passwords
import sys
from itertools import combinations as cb
input = sys.stdin.readline
def f(u):
if u != p[u]:p[u] = f(p[u])
return p[u]
N = int(input())
p = [0] * 26
for i in range(26):
p[i] = i
vst = set()
for i in range(N):
t = input().rstrip()
al = set()
for a in t:
k = ord(a) - 97
al.add(k)
vst.add(k)
if len(al) > 1:
for u,v in cb(al, 2):
if f(u) != f(v):
p[f(u)] = p[f(v)]
q = set()
for w in vst:
q.add(p[f(w)])
print(len(q))
B 핵 당한 분들이 많아서 등수가 꽤 높아졌다.
E는 끝나고 나서 풀어보려고 했지만 결국 못풀었다.
들은거로는 세그 레이지 안써도 풀린다고 한다..
지지난 코포에서 런타임 에러 크리티컬에 1솔로 -77 하고 충격을 받았으나
다시 같은 점수로 복구했다.
대강 두번 1000등하거나
한번 500등 하면 블루 갈거같다.
올해 안에 갔으면..
'알고리즘 > Codeforces, AtCoder' 카테고리의 다른 글
AtCoder ABC 174 후기 (첫 올솔브) (0) | 2020.08.04 |
---|---|
Codeforces Global Round 7 후기 (0) | 2020.03.20 |
Codeforces Round #599 (Div. 2) 후기 (0) | 2019.11.07 |