https://codeup.kr/problemsetsol.php?psid=23 provides basic p-sets for algo tests.
They might be very helpful for the implementation problems. (such as 1097 and 1099)
These are the ones that are not familiar with me. Get used to it !!
a, b, c = map(int, input().split('.'))
print("{}.{:02d}.{:02d}".format(a,b,c))
print(input().replace('-',''))
a = input()
for i in range(len(a)):
print('[' + a[i] + '0'*(len(a)-i-1) + ']' )
print("{:X}".format(int(input())))
print(int(input(), 8))
print(oct(int(input(), 16))[2:])
print(ord(input()))
print(chr(int(input())))
Note that join’s parameter must be string
print('\n'.join(str(i) for i in map(int, input().split()) if i % 2 == 0))
import itertools
n = [i for i in range(int(input())+1) if i % 2 == 0]
ans = list(itertools.accumulate(n))
print(ans[-1])
n = input()
for i in range(1,16):
print(n + '*' + str(hex(i)[2:]).upper() + '=' + str(hex(int(n, 16)*i).upper()[2:]))
g = [[0] * 19 for _ in range(19)]
for _ in range(int(input())):
i, j = map(int, input().split())
g[i-1][j-1] = 1
for i in range(19):
print(' '.join(str(j) for j in g[i]))
g = [[0] * 19 for _ in range(19)]
for i in range(19):
g[i] = list(map(int, input().split()))
for _ in range(int(input())):
a, b = map(int, input().split())
for i in range(19):
for j in range(19):
if i == b-1 or j == a-1:
g[j][i] = 1 if g[j][i] == 0 else 0
g[a-1][b-1] = 1 if g[a-1][b-1] == 0 else 0
for i in range(19):
print(' '.join(str(j) for j in g[i]))
# Using direction vector and dfs for optimization
g = [0]*10
for i in range(10):
g[i] = list(map(int, input().split()))
visited = [[0]*10 for _ in range(10)]
dx, dy = [1,0], [0, 1]
def dfs(x, y):
if g[y][x] == 2:
g[y][x] = 9
return
visited[y][x] = 1
g[y][x] = 9
for i in range(2):
xx, yy = x + dx[i], y + dy[i]
if xx < 10 and yy < 10:
if g[yy][xx] != 1 and not visited[yy][xx]:
dfs(xx,yy)
return
dfs(1,1)
for i in range(10): print(' '.join(str(i) for i in g[i]))
# # timeout
# while i != 9 or j != 9:
# g[i][j] = 9
# if g[i][j+1] == 0:
# j += 1
# elif g[i][j+1] == 2:
# g[i][j+1] = 9
# break
# elif g[i+1][j] == 0:
# i += 1
# elif g[i+1][j] == 2:
# g[i+1][j] = 9
# break