Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
**/._.DS_Store

# IntelliJ project files
.idea
.idea/*.xml
*.iml
out
gen
build
rebel.xml
19 changes: 19 additions & 0 deletions Beakjoon/atsunset529/week_3/그룹단어체커.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

### [Baekjoon-1316] 그룹단어체커

cnt = 0
n = int(input())
#words = list(map(str, input().lower().split()))

for i in range(n):
if n < 101:
word = input()
if list(word) == sorted(word, key=word.find): #only sorted: cbac->abcc, with .find->ccba
cnt += 1
else:
print("n < 101")
break

print(cnt)

#https://www.acmicpc.net/problem/1316
17 changes: 17 additions & 0 deletions Beakjoon/atsunset529/week_3/셀프_넘버.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

### [Baekjoon-4673] 셀프넘버


numbers = set(range(1, 10001))
non_selfnumbers = set()

#n을 d(n)의 생성자라 하고 셀프넘버는 생성자가 없는 숫자
#이때 dn은 수열; 33 + 3 + 3 = 39이고, 그 다음 수는 39 + 3 + 9 = 51
for d_n in numbers:
for n in str(d_n):
d_n += int(n)
non_selfnumbers.add(d_n) #셀프넘버가 아닌 숫자를 집합에 추가

selfnum = numbers - non_selfnumbers #둘 다 집합이라 차집합 계산
print(sorted(selfnum)) #정렬
#https://www.acmicpc.net/problem/4673
25 changes: 25 additions & 0 deletions Beakjoon/atsunset529/week_3/소수찾기.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

### [Baekjoon-1978] 소수찾기

n = int(input())
data = list(map(int, input().split()))
prime_num = 0

if n == len(data): #첫줄 수의 갯수 n

for i in data: #n개중 소수의 개수 구하기
cnt = 0
if(i == 1):
continue
for j in range(2, i+1):
if(i % j == 0): #2~자신의 수까지 나누어떨어지는지
cnt += 1
if(cnt == 1): #자신으로 나눈 하나만 나머지가 없었다면 소수
prime_num += 1

print(prime_num)

else:
print("첫번째 입력한 숫자를 확인하세요")

#https://www.acmicpc.net/problem/1978
Empty file.
16 changes: 16 additions & 0 deletions Programmers/atsunset529/week_1/완주하지못한선수.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#[Programmers] 완주하지못한선수

def solution(participant, completion):
participant = sorted(participant) #['filipa', 'josipa', 'marina', 'nikola', 'vinko']
completion = sorted(completion) #['filipa', 'josipa', 'marina', 'nikola']

for i in range(len(completion)):
if participant[i] != completion[i]: #예시는 지금 이경우 없음
answer = participant[i]
return answer

answer = participant[-1] #없으면 리스트 마지막인 vinko출력
return answer

#https://school.programmers.co.kr/learn/courses/30/lessons/42576?language=python3#

13 changes: 13 additions & 0 deletions Programmers/atsunset529/week_1/전화번호목록.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#[Programmers] 전화번호목록

def solution(phone_book):
phone_book = sorted(phone_book) #문자로 정렬

for i in range(len(phone_book)):
for j in range(len(phone_book)):
if i != j and phone_book[i].startswith(phone_book[j]): #i가 j로 시작하면 false출력
return False

return True

#https://school.programmers.co.kr/learn/courses/30/lessons/42577?language=python3
1 change: 1 addition & 0 deletions Programmers/atsunset529/week_2/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("????")