전체 글

[쉽게 푸는 문제]-1292번 검색 www.acmicpc.net My answer a,b=input().split() a=int(a) b=int(b) tmp=[] sum=0 for i in range(b): if(len(tmp)>b): break while(tmp.count(i+1)!=i+1): if(len(tmp)>b): break tmp.append(i+1) for i in range(a-1,b): sum+=tmp[i] print(sum) Another answer p=[] for i in range(1,46): p+=[i]*i a,b=map(int,input().split()) print(sum(p[a-1:b])) 더보기 어제부터 계속 나오는데 input받을 때 map 쓰는 걸 익숙해져야겠다. 우선..
[약수구하기]-2501번 2501번: 약수 구하기 첫째 줄에 N과 K가 빈칸을 사이에 두고 주어진다. N은 1 이상 10,000 이하이다. K는 1 이상 N 이하이다. www.acmicpc.net My answer divisor=[] N,k=input().split() N=int(N) k=int(k) for i in range(1,N+1): if(N%i==0): divisor.append(i) if(len(divisor)
입출력 (백준: 2557, 1000, 2558, 10950, 10951, 10952, 10953, 11021, 11022, 11718, 11719, 11720, 11721, 2741, 2742, 2739, 1924, 8393, 10818, 2438, 2439, 2440, 2441, 2442, 2445, 2522, 2446, 10991, 10992) 정렬(버블, 선택, 삽입, 머지, 퀵 ) - 공간 복잡도 확인 - 시간 복잡도 확인 동적프로그래밍(Dynamic Programing)* (백준: 1463, 11726, 11727, 9095, 10844, 11057, 2193, 9465, 2156, 11053, 11055, 11722, 11054, 1912, 2579, 1699, 2133, 9461, 2225,..
· 잡담
그동안 코테준비를 멈추고 ADSP 자격증 준비를 했다. ADSP는 응시자격이 없다. ADP(데이터분석전문가)부터 응시자격이 존재한다. 우선 나는 가장 유명한 교재로 공부를 시작했다. 인터넷을 뒤져보니 대부분의 사람들이 비전공자는 3주?정도 전공자는 짧게는 3일~2주정도 잡고 공부한다고 했다. 나는 전공자이긴 하지만 자격증 시험이 처음이라 3주의 넉넉한 시간을 잡고 공부를 시작했다. [공부 방법] 우선 1과목은 그냥 책을 술술 읽었다. 외워야 할 것 같은건 외우고 과목별 바로 뒤에 있는 예상문제만 3~4번씩 반복해서 안틀릴때 까지 풀었던 것 같다. 다음으로 2과목에 들어가니까 외워야할 것처럼 생긴게 너무 많아서 이렇게 무식하게 공부하면 안될 것 같아서 뒤져보니까 https://www.youtube.com/..
[구명보트] My answer def solution(people, limit): answer = 0 people.sort() while(people!=[]): #wmin=min(people) wmin=people[0] #wmax=max(people) wmax=people[-1] if(wmin+wmax1): people=people[1:-1] #people.remove(wmin) #people.remove(wmax) else: people=people[1:] #people.remove(wmin) else: answer+=1 people=people[:-1] #people.remove(wmax) return answer ------------------------------------------------..
[7주차_입실 퇴실]-[위클리챌린지] My answer-시간초과 def solution(enter, leave): answer = [0]*len(enter) n=len(enter) for i in range(1,n+1): for j in range(1,n+1): if(i!=j): etmpi, etmpj=enter.index(i),enter.index(j) ltmpi, ltmpj=leave.index(i), leave.index(j) if(etmpi>etmpj and ltmpi
[방문 길이]-[Summer/Winter Coding(~2018)] My answer def solution(dirs): answer = set() posx,posy,tmpx,tmpy=0,0,0,0 for i in dirs: tmpx,tmpy=posx,posy if(i=='U' and posy!=5): posy+=1 elif(i=='D' and posy!=-5): posy-=1 elif(i=='R' and posx!=5): posx+=1 elif(i=='L' and posx!=-5): posx-=1 if((posx,posy)==(tmpx,tmpy)): continue answer.add((posx,posy,tmpx,tmpy)) answer.add((tmpx,tmpy,posx,posy)) return le..
창빵맨
Let's be Developers