1978. 소수 찾기 풀이 소수란 1과 자신만을 약수로 갖는 수를 뜻한다. 따라서 1 이상의 수에서, 나누기를 했을 때 나머지가 0일 때마다 카운팅을 해 주는데 이때 카운팅이 1이라는 것은 1을 제외하고 자기 자신뿐이라는 뜻이다. 따라서 이때 결과를 카운팅해주면 된다. import sys sys.stdin = open("1978_소수찾기_input.txt", "r") n = int(sys.stdin.readline()) nums = list(map(int, sys.stdin.readline().split())) result = 0 for num in nums: cnt = 0 # 숫자마다 카운팅을 해야하기 때문에 초기화 if num > 1: for i in range(2, num+1): if num % i..
11399. ATM 풀이 대기시간이 최소시간이 되기 위해서는 오름차순으로 정렬이 되어야 한다. 또한 이 전의 값을 계속 누적해가며 더해준다면 어렵지 않게 답을 구할 수 있다. import sys sys.stdin = open("11399_ATM_input.txt", "r") n = int(sys.stdin.readline()) waits = list(map(int, sys.stdin.readline().split())) times = 0 result = [] waits.sort() for i in waits: times = i + times result.append(times) print(sum(result))
맥주 마시면서 걸어가기 from collections import deque import sys sys.stdin = open("9205_맥주마시면서걸어가기_input.txt", "r") t = int(sys.stdin.readline()) def bfs(): queue = deque() queue.append((home[0], home[1])) while queue: x, y = queue.popleft() if abs(x - rock_festival[0]) + abs(y - rock_festival[1])
- Total
- Today
- Yesterday
- DFS
- Python
- HDFS
- Elasticsearch
- elasticsaerch
- 이코테
- CS
- 빅데이터를지탱하는기술
- Espher
- heapq
- OS
- 네트워크
- 프로그래머스
- 백준
- Algorithm
- kubernetes
- kafka
- 파이썬
- Flutter
- mahout
- cka
- oozie
- 빅데이터
- DP
- Hadoop
- logstash
- BOJ
- sqoop
- CSAPP
- GROK
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |