boj step 4 rework
This commit is contained in:
8
zeta_python/completed/10807.py
Normal file
8
zeta_python/completed/10807.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
N = int(input())
|
||||||
|
L = list(map(int, input().split()))
|
||||||
|
v = int(input())
|
||||||
|
c = 0
|
||||||
|
for x in L:
|
||||||
|
if x == v:
|
||||||
|
c += 1
|
||||||
|
print(c)
|
||||||
8
zeta_python/completed/10810.py
Normal file
8
zeta_python/completed/10810.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
N, M = map(int, input().split())
|
||||||
|
L = [0 for _ in range(N)]
|
||||||
|
for _ in range(M):
|
||||||
|
i, j, k = map(int, input().split())
|
||||||
|
for m in range(i - 1, j):
|
||||||
|
L[m] = k
|
||||||
|
|
||||||
|
print(" ".join(map(str, L)))
|
||||||
7
zeta_python/completed/10811.py
Normal file
7
zeta_python/completed/10811.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
N, M = map(int, input().split())
|
||||||
|
L = [i + 1 for i in range(N)]
|
||||||
|
for _ in range(M):
|
||||||
|
i, j = map(int, input().split())
|
||||||
|
L[i - 1:j] = reversed(L[i - 1:j])
|
||||||
|
|
||||||
|
print(" ".join(map(str, L)))
|
||||||
14
zeta_python/completed/10813.py
Normal file
14
zeta_python/completed/10813.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
N, M = map(int, input().split())
|
||||||
|
L = [i for i in range(1, N + 1)]
|
||||||
|
|
||||||
|
|
||||||
|
def swap(i, j):
|
||||||
|
global L
|
||||||
|
L[i - 1], L[j - 1] = L[j - 1], L[i - 1]
|
||||||
|
|
||||||
|
|
||||||
|
for _ in range(M):
|
||||||
|
i, j = map(int, input().split())
|
||||||
|
swap(i, j)
|
||||||
|
|
||||||
|
print(" ".join(map(str, L)))
|
||||||
7
zeta_python/completed/5597.py
Normal file
7
zeta_python/completed/5597.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
L = [i + 1 for i in range(30)]
|
||||||
|
for _ in range(28):
|
||||||
|
i = int(input()) - 1
|
||||||
|
L[i] = False
|
||||||
|
|
||||||
|
for i in L:
|
||||||
|
print(i) if i else 0
|
||||||
Reference in New Issue
Block a user