๐ Python3 ์ฝ๋
๋ฐฑ์ค 10807
n = int(input())
n_list = list(map(int, input().split()))
v = int(input())
print(n_list.count(v))
โญ๏ธ 1์ฐจ์ ๋ฐฐ์ด์์ ๊ฐ๋จํ๊ฒ ํด๋น ์์๊ฐ ๋ช ๊ฐ ๋ค์ด์๋์ง ์๊ณ ์ถ๋ค๋ฉด count() ์ฐ๊ธฐ.
๋ฐฑ์ค 5597
students = [i for i in range(1,31)]
for _ in range(28):
applied = int(input())
students.remove(applied) #์๊ฑฐ
print(min(students))
print(max(students))
- ๊ต์ค์ ํ์์ด 30๋ช ์ด ์๋ค๊ณ ํ๋๊น 1 ~ 30๊น์ง ์๋ฅผ student ๋ฆฌ์คํธ์ ์ ์ฅํ๋ค.
- applied ๋ณ์์ ํ ๋น๋๊ณ ์์ฐจ์ ์ผ๋ก ์ ์ฅ
'Coding Test' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[TIL/10.21] Algorithm: ์๋ฃ๊ตฌ์กฐ ๊ธฐ์ด์ DFS/BFS (0) | 2023.10.22 |
---|---|
[TIL/10.20] Algorithm: ๊ตฌํ (0) | 2023.10.19 |
[TIL/10.19] Algorithm: ๊ทธ๋ฆฌ๋ ์๊ณ ๋ฆฌ์ฆ (0) | 2023.10.19 |
[TIL/10.14] ๋ฐฑ์ค - 2์ฐจ์ ๋ฐฐ์ด ๊ณจ๋ผํ๊ธฐ (0) | 2023.10.14 |
[TIL/10.14] ๋ฐฑ์ค ๊ธฐ์ด- ์กฐ๊ฑด๋ฌธ ๊ณจ๋ผํ๊ธฐ (0) | 2023.10.14 |